I have been trying to solve this Python "Depending on Parity" problem for two days straight and have no idea what to do now.
The problem : elif Statements 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 An integer is even if it is divisible by two and odd if it is not even. My codes : 1). number = input() #your code goes here even = number % 2 == 0 odd = number % 2 != 0 if even: print(number * 2) elif odd: print(number * 3) else: print(0) 2). number = input() #your code goes here if number % 2 == 0: print(number * 2) elif number % 2 != 0: print(number * 3) elif number == 0: print(0) else: print(0) Any suggestions will be greatly appreciated.