- 1

Write a python programme to enter a number and print it's square if it's even and cube if it's odd.

6th Jun 2018, 4:27 PM
Rehma Manal
Rehma Manal - avatar
4 Réponses
+ 4
Write a program that outputs your own homework.
6th Jun 2018, 5:00 PM
non
+ 4
One line: print((lambda x: x**3 if x % 2 else x ** 2)(int(input())))
6th Jun 2018, 11:04 PM
blackcat1111
blackcat1111 - avatar
+ 3
n=int(input()) if(n%2==0): print(n**2) else: print(n**3)
6th Jun 2018, 4:37 PM
Pulkit Kamboj
Pulkit Kamboj - avatar
7th Jun 2018, 11:39 AM
Johannes
Johannes - avatar