0
How can I make the below code to accept input from users???
def average(n1,n2,n3): total= int(n1) + int(n2) + int(n3) Avg = total/3 return Avg print(average(5,2,3))
2 odpowiedzi
+ 3
print(average(input(), input(), input()))
+ 1
Hi Al-hassan Rabi'u
There is a input() function in python for taking user input, input accepts str input if you want to take a input as a int, then you have to convert your str in int, using int() function!
Conclusion : int(input())