Python Essentials Classroom Series – 16/Sept/2021

Solving Hacker Rank Problems

n = int(input().strip())

if 1 <= n <= 100:
    remainder = n % 2
    if remainder == 1:
        print('Weird')
    else:
        if 2 <= n <= 5:
            print('Not Weird')
        elif 6 <= n <= 20:
            print('Weird')
        else:
            print('Not Weird')
        
  • Refer Here for the problem of Arthimetic operators
a = int(input())
b = int(input())
print(a+b)
print(a-b)
print(a*b)
a = int(input())
b = int(input())
print(a//b)
print(a/b)
n = int(input())
if 1 <= n <= 20:
    for index in range(n):
        print(index*index)
  • Try to solve the problem Refer Here without using sort but you are allowed to use max

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin