Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. #coding:utf-8
  2.  
  3. def func_with_var_params(*params):
  4.     print("Cette fonction prend un nombre variable de paramètres...")
  5.     print("Paramètres passés : {}".format(params))
  6.     print("---------------------------------------------------------")
  7.  
  8.  
  9. # Appel sans arguments
  10. func_with_var_params()
  11.  
  12. # Appel avec un argument
  13. func_with_var_params('hello')
  14.  
  15. # Appel avec plusieurs arguments
  16. func_with_var_params('hello', 14, 46.5, [1, 2, 3, '4'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement