How to give null value to a variable? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to give null value to a variable?

x=int(input()) y=int(input()) try: z=input() finally : userList = [x,y,z] sum = 0 for num in userList: a=int(num) if(a%2 == 0): sum += int(num) print(sum)

9th Apr 2020, 12:41 PM
madhan mallisetty
madhan mallisetty - avatar
1 Answer
+ 2
Z=input()or 0
9th Apr 2020, 12:47 PM
Oma Falk
Oma Falk - avatar