0
Need help with a practice question
hello there, i've encountered a problem in a pratie question whereby I cant get the desired output, instead it turned into a string operation. This is in python code. Here is the question: 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 This is the code that I used: number = input() #your code goes here if number == "/2": print(number*2) elif number == "0": print("0") else: print(number*3)
2 Answers
+ 2
I think this will help you
https://code.sololearn.com/cyK32pDjSkad/?ref=app
0
Soumik thank you it works ! Didnt think of using quotient to do it