+ 1

why this code doesn’t work?

print( x := int(input) + y := int(input())) P.S. i know that you can do it way simpler than that im just curious why this is mistake

20th Jul 2022, 6:34 PM
Lakarov
Lakarov - avatar
3 Respostas
+ 1
Missing () for first input() And put braces around y assingment print( (x := int(input()))+ (y := int(input())))
20th Jul 2022, 7:11 PM
Jayakrishna 🇮🇳
+ 2
print( (x := int(input())) + (y := int(input()))) print((str(3))+str(5)) print('The sum is %.1f' %(float(input('Enter first number: '))+float(input('Enter second number: ')))) Only missing braces
20th Jul 2022, 7:10 PM
**🇦🇪|🇦🇪**
**🇦🇪|🇦🇪** - avatar
+ 1
Jayakrishna🇮🇳 thank you very much, i was feeling really stupid at the moment :D
20th Jul 2022, 7:13 PM
Lakarov
Lakarov - avatar