During the lecture I have created the functions but those functions are not working. Below are the codes I wrote please advise , nothing comes at output.
def addtwo(a,b):
added = a + b:
return added
x = addtwo(2 , 3)
print(x)
Other one
def thing():
x = int(input('enter x '))
y = int(input('enter y '))
print(x)
print(y)
if x > 0 and x < 10 or y > 10 and y < 20:
print(‘yes’)
else:
print('no')
print ('yes')
and last one
def greet(lang):
if lang == ‘fr’:
print(‘bonjour’)
elif lang == ‘es’:
print(‘hola’)
else:
print(‘hello’)
error for same is
greet(fr)
NameError Traceback (most recent call last)
in
----> 1 greet(fr)
NameError: name ‘fr’ is not defined