HackerRank Python If-Else Solution Explained - Python

preview_player
Показать описание


Preparing For Your Coding Interviews? Use These Resources
————————————————————

Other Social Media
----------------------------------------------

Show Support
------------------------------------------------------------------------------

#coding #programming #softwareengineering
Рекомендации по теме
Комментарии
Автор

Mind Blowing I am Solving This Problem Last 3 Hours

karanjoshi
Автор

Hi, how can i use while loop for this problem. Here is my code. But it HR website is saying it is wrong. Can you tell me why it is so.
n=range(1, 101)
n = int(input("Enter a number between 1 and 100:"))
while n%2==0 and n<101:
if n<=5 or 20<n<=100:
print("Not Weird")

else:
print("Weird")

break
else:
print("Weird")

janakiyeluripati
Автор

Remember Pythonistas don't use brackets in if/elif statements whatsoever. Thank you for the video.

abdifatahmoh
Автор

I tryed your code but also its showing test case error what i have to do?

kishore
Автор

Ok. I understand code but how i can run To take input from the user and print the result? :D

patrykkedzierski
Автор

why is mine not working? the elif in the 6 to 20 :<

kawaii_
Автор

thanks a lot this helped me a lot love from India

pushpakanwar