Friday, September 11, 2020

python program to accept 4 integers in the same line and display their sum

 python program to accept 4 integers in the same line and display their sum


 

python program to accept 4 integers in the same line and display their sum

==============================================================

Code:

var1 ,var2,var3,var4 = [int(x) for x in input("Enter four numbers:").split()]

print('Sum =',var1+var2+var3+var4)

 

Output:

Enter four numbers: 11 12 13 14

Sum = 50

 

 


No comments:

Post a Comment

Durga Puja in Odisha

 Durga Puja in Odisha