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)

10th Sep 2020, 7:19 PM
Amritendu Bhattacharya
Amritendu Bhattacharya - avatar
2 Antworten
+ 5
number = int(input()) and 0%2==0
10th Sep 2020, 7:23 PM
Julia Shabanova
Julia Shabanova - avatar
+ 1
Thank you, it worked.🙏
10th Sep 2020, 7:28 PM
Amritendu Bhattacharya
Amritendu Bhattacharya - avatar