JAFFA-PROBLEM
Submit solution
Python
Points:
10 (partial)
Time limit:
5.0s
Memory limit:
64M
Author:
Problem type
Allowed languages
Python If-Else
Task Given an integer, , perform the following conditional actions: If is odd, print Weird If is even and in the inclusive range of to , print Not Weird If is even and in the inclusive range of to , print Weird If is even and greater than , print Not Weird
Input Format A single line containing a positive integer, .
Constraints
Output Format Print Weird if the number is weird; otherwise, print Not Weird .
Comments
n = int(input()) if n % 2 == 1: print("Weird") elif n % 2 == 0 and 2 <= n <= 5: print("Not Weird") elif n % 2 == 0 and 6 <= n <= 20: print("Weird") else: print("Not Weird")
THe question is not clearr
a=int(input()) l=[] for i in range(0,a): b=input() x=b.split() if(x[0]=='insert'): t=int(x[1]) l.insert(t,int(x[2])) if(x[0]=='print'): print(l) if(x[0]=='append'): l.append(int(x[1])) if(x[0]=='pop'): l.pop() if(x[0]=='reverse'): l.reverse() if(x[0]=='sort'): l.sort() if(x[0]=='remove'): l.remove(int(x[1]))
.