Please help me fix this.
I want to make a function that show the sum of two numbers, but this doesn't work. def sumOf2(n1,n2): n1 = int(input()) n2 = int(input()) x = n1+n2 return x total = sumOf2
https://code.sololearn.com/c8h4J7m110EH n1 = int(input()) n2 = int(input()) def sumOf2(n1,n2): x=n1+n2 return x total = sumOf2(n1,n2) print(total)
Your function doesn't need parameters if you take input inside the function Also you forgot the () when you call the function
As Lisa explained, the correct code is below: def sumOf2(): n1 = int(input()) n2 = int(input()) x = n1+n2 return x total = sumOf2() print(total) And you might want to add print at the end to see your result :)
I have tried every way I could find but still I can't display my local images ..what am I doing wrong?
I cant understand what the problem here is. Can anyone help me out? the system in sololearn called it an error in test case 1
Izzy the iguana code coach
Hi, hope you're doing good.Could someone please tell me why does the while loop not stop when I type in rock, paper or scissors?
Finished python for beginners