def check(num):
if num2 - num1 >0:
if (num > num1) and (num < num2):
print(num,"falls in given range")
else:
print(num,"doesn't fall in given range")
else:
print("ERROR!!")
num1 = int(input("Enter Minimum Number: "))
num2 = int(input("Enter Maximum Number: "))
num = int(input("Enter number to be checked: "))
check(num)
Enter Minimum Number: 15 Enter Maximum Number: 100 Enter number to be checked: 75 75 falls in given range
num = int(input("Enter number of cards: "))
if (num % 2 == 0):
print("Cards after reduction are: ",(num/2))
else:
print("Cards after reduction are: ",(num//2))
Enter number of cards: 15 Cards after reduction are: 7
from random import randint
x = int(input("Enter a Positive Number: "))
rand_int = randint(x, x+10)
for i in range(rand_int):
print("A", end = " ")
Enter a Positive Number: 15 A A A A A A A A A A A A A A A A A A A A A A
a = int(input("Enter Starting hour: "))
b = int(input("Enter Ending hour: "))
if a and b in range(0,23):
if a >= b:
print("Total Bill is: $",(24 - a + b)*5.50)
else:
print("Total Bill is: $",(b - a)*5.50)
else:
print("Wrong Input!!!")
Enter Starting hour: 14 Enter Ending hour: 18 Total Bill is: $ 22.0
from random import randint
count = 0
for i in range(0,10000):
roll_1 = randint(1,6)
roll_2 = randint(1,6)
if roll_1 == roll_2:
count = count + 1
print("Final Percentage of Rolls that are doubles is: ", (100*count)/10000)
Final Percentage of Rolls that are doubles is: 16.33