#2 : Python If-Else | Hackerrank Python Solutions

preview_player
Показать описание
Thanks if u r Watching us....
#Python #Dev19 #HackerankSOlutions #C #C++ #Java #Python
Please Subscribe Us ....
Рекомендации по теме
Комментарии
Автор

Very simply u had done it but I wrote 5 lines of code for that 👍

sanjaysanjay
Автор

just saw your channel and subscribed. Your doing very nice work, keep it up! bro

PARAGK
Автор

Hello there ur doing a great work 😀😀..just wanted to clarify on some things.. according to the question we need to print "Not Weird" for even number within the range 2 to 5 and when n>20 .. i have specified the condition and checked my custom test case by inputting 0 and it said "no response" which is right..but when i didn't mention any conditions and input 0 it printed "Not Weird" .. both the codes passed all the sample test cases though.. i feel specifying the condition will bring more clarity to the audience

dangeroussarcasm
Автор

I was writing big lines of code and getting it all wrong😂😂😂good lord man

blakecamilletv
Автор

if __name__ == '__main__':
n = int(input().strip())
if (n%2!=0) or (n>=6 and n<=20):
print("weird")
else:
print("not weird") ...i am typing also but why it is not giving me output

feokhtz
Автор

Thanks to lord shiva🙏🤩😇❤️❤️❤️❤️Thankyou😇😇😇🙌

amruthasankar
Автор

WHATS WRONG IN THIS CODE?CAN ANYONE PLEASE TELL ME.THANKS

n=int(input("enter any number\n"))
if (n%2!=0):
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")

supratikpaul
Автор

Someone please explain to me (n%2!=0) means?

welime
Автор

This code is not running .. Showing error

shaluraipuriya
Автор

weird kii spelling galat likha tha and 1st word uper case nahi lika jikee karan 2 ghantee barbad honee kee bad abhi answer mila

pranavsing
Автор

Bhai ek toh tu Hindi bol ya English bolde, dono mix karke maat bol..
aur agar hindi bolne me sharam aarahi he tu English sudar le...

bennymathew
Автор

this is my code any i sucessfully got it run all test cases hope it helps


n= int(input())
if (n % 2!=0) or (n >= 6 and n <=20) :
print("Weird")
else :
print ("Not Weird")

stockmarketuniversity