+ 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
7 Answers
+ 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)
+ 5
please give me link of that code coach i will try to help you.
+ 2
thank you Martin Ed for helping me out
+ 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)
0
Cheenuđ here is the link
https://sololearn.com/coach/133/?ref=app
0
4
0
wow great answer