# https://www.geeksforgeeks.org/random-numbers-in-python/https://www.geeksforgeeks.org/random-numbers-in-python/ import random num = random.random() print("Random number is: ",num) # import random import random # prints a random value from the list list1 = [1, 2, 3, 4, 5, 6] print(" prints a random value from the list 1 to 6:",random.choice(list1)) # prints a random item from the string string = "striver" print("prints a random item from the string of striver: ",random.choice(string)) # Random integer between 40 and 100 (inclusive) random_int = random.randint(40, 100) print(random_int) n = input('Enter the Number: ') print('Number Entered by User:',n) print(type(n)) a = 10 b = 20 print(a == b) print(int(n) == random_int) if (int(n) == random_int): print(int(n),'is equal ', random_int) else: print(int(n),'is NOT equal ', random_int) a = 200 b = 33 if b > a: print("b is greater than a") elif a == b: print("a and b are equal") else: print("a is greater than b") # One line, Ternary Operators, or Conditional Expressions. multiple else statements on the same line: print("A") if a > b else print("=") if a == b else print("B")