0
If/Else Python 3
n = int(input()) odd = range(1,100,2) even = range(2,5,2) odder_still = range(6,22,2) if n in odd: print("Weird") elif n in even: print("Not Weird") elif n in odder_still: print("Weird") else: print("Not Weird") Edit2: changed -"odd = range(3,20,2)" to "odd = range(1,100,2)" -"even = range(2,20,2)" to "even = range(2,5,2)" -"odder_still = n <= 21" to "odder_still = range(6,22,2)" added -"elif n in even"
2 odpowiedzi
+ 1
Sorry it took so long to get back to you. I had some further tinkering to do. Thank you so much for all your help.