+ 6

# PYTHON ELIF PRACTICE DIFFICULTIES

I was trying the pro side practice feature and got stuck on a problem the practice was to make a program that would take a number as input and output the twice of number if it is a even number and output thrice the number if the number was even and it would output 0 if the number was zero. I made the program it ran successfully but showed error in the task 5 part other all went good please help me with this. Here’s the link to the problem https://sololearn.com/coach/133/?ref=app

3rd Jan 2021, 5:33 PM
Harnoor Singh
7 ответов
+ 5
# my attempt to solve this number = int(input()) #your code goes here if number == 0: print("0") elif number%2 == 0: print(number*2) else: print(number*3)
3rd Jan 2021, 5:46 PM
Martin Ed
+ 5
3rd Jan 2021, 5:40 PM
RTK-AMAN
+ 2
thank you Martin Ed for helping me out
3rd Jan 2021, 5:50 PM
Harnoor Singh
+ 1
number = int(input()) #your code goes here if number == 0: print(number) elif number%2 == 0 and number != 0: print(number*2) else: print(number*3)
3rd Jan 2021, 9:22 PM