+ 1

Python: Could you please help me regarding this?

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 Sample Input: 1 Sample Output: 3 My try number = input() number=x x+=1 if x%2==0: print (x*2) else: print (x*3)

30th Nov 2020, 1:01 PM
Md Imraj Hossain
Md Imraj Hossain - avatar
5 odpowiedzi
+ 3
Of course! Link your attempt code here in this post so we can see where you're having problems
30th Nov 2020, 1:03 PM
Slick
Slick - avatar
+ 1
number = input() number=x x+=1 if x%2==0: print (x*2) else: print (x*3)
30th Nov 2020, 1:07 PM
Md Imraj Hossain
Md Imraj Hossain - avatar
+ 1
No problem! And okay, as in..?
30th Nov 2020, 1:25 PM
Slick
Slick - avatar
0
Thanks for this Slick , but SoloLearn goes some steps higher while giving code coach challange.
30th Nov 2020, 1:24 PM
Md Imraj Hossain
Md Imraj Hossain - avatar