0
I am getting an error for below code, can someone help
The problem is : Write a program that takes a number as input and #returns its double, if the number is even #returns its triple, if the number is odd #returns 0, if number is 0 #Write a program that takes a number as input and #returns its double, if the number is even #returns its triple, if the number is odd #returns 0, if number is 0 I wrote the following code, however, it is returning an error. number = input() if number % 2 == 0 : print (number * 2) elif number % 2 > 0 : print (number * 3) else : print (0)
2 Answers
+ 5
number = int(input())
and 0%2==0
+ 1
Thank you, it worked.đ