can i define a function that asks for a user input add then prints the result. | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 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 Réponse
+ 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