python default arguments
def my_function(name, age = 20):
print(name + " is " + str(age) + " years old"
my_function("Mitro") # Mitro is 20 years old
my_function("Mitro", 26) #Mitro is 26 years old
python default arguments
def my_function(name, age = 20):
print(name + " is " + str(age) + " years old"
my_function("Mitro") # Mitro is 20 years old
my_function("Mitro", 26) #Mitro is 26 years old
arguments with default parameters python
def screen_size(screen_size=80):
return screen_aize
screen_size(120) # the screen size is 120
screen_size() # the screen size is 80 as default
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us