Hii, ps anyone solve this problem, using condition function in python...I have been tried lot but those are throwing me syntax e | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Hii, ps anyone solve this problem, using condition function in python...I have been tried lot but those are throwing me syntax e

Given an integer,n  , perform the following conditional actions: If  n is odd, print Weird If n is even and in the inclusive range of  to , print Not Weird If n  is even and in the inclusive range of  to , print Weird If n  is even and greater than , print Not Weird

27th Mar 2020, 11:48 AM
Hëllo Wörld🔰
Hëllo Wörld🔰 - avatar
7 Answers
+ 4
Jayakrishna🇮🇳 Actually i also don't know, what is inclusive range, its from hacker rank.. My codes are lot of error lol little bit feeling shame to share😅, anyway here bit https://code.sololearn.com/csDgvRPw29Xm/?ref=app
27th Mar 2020, 12:04 PM
Hëllo Wörld🔰
Hëllo Wörld🔰 - avatar
+ 2
If you show your try which producing errors then someone try to correct it.. So please share your try... Please recheck about your description.. It have 2 conditions are same for if, are you missing anything or a typo..? What is inclusive range..?
27th Mar 2020, 11:57 AM
Jayakrishna 🇮🇳
+ 2
Jayakrishna🇮🇳 thank u very much, I can see my errors,
27th Mar 2020, 12:44 PM
Hëllo Wörld🔰
Hëllo Wörld🔰 - avatar
27th Mar 2020, 12:32 PM
Jayakrishna 🇮🇳
+ 1
👑Kunyu👑 You're Wel come.. Feel free to ask even if it basic or not.. Always first try by yourself. If you stuck between then ask community by posting your try that may have errors.. Just tell what you know, and what you want to know. Some one definitely answer.. Happy coding..
27th Mar 2020, 12:53 PM
Jayakrishna 🇮🇳
0
👑Kunyu👑 OK. Post that try.. Which have errors.. If n%2== 1 : print("weird") if(n%2==0 and 0<n>10) #inclusive range for example 0 to 10 print("not weird") elif n%2==0 and 0>n<10: print("weird") else print("Not weird") //this will not printed according to your description, it is not clear. A sample, make identation, post your tried code. Better to link that hacker rank page.
27th Mar 2020, 12:18 PM
Jayakrishna 🇮🇳