can i define a function that asks for a user input add then prints the result. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

can i define a function that asks for a user input add then prints the result.

def add_number(x=float(input()),y=float(input())): print (x+y)

16th Aug 2016, 7:51 AM
Kaka
Kaka - avatar
1 Answer
+ 4
def add_number_for_user_input(): x = float(input()) y = float(input()) print(x+y)
16th Aug 2016, 8:30 AM
jimmy chen
jimmy chen - avatar