Programming Challenge 1/99 Higher/lower

Today’s code is quite easy, so there will be no explanation.

import random

def main():
	enter = input("Choose a number from 1 to 6:\n")
	your_num = int(enter)
	rand_num = random.randint(1,6)
	if your_num > rand_num:
		print("Lower")
	elif your_num < rand_num:
		print("Higher")
	elif your_num == rand_num:
		print("Correct")
		return
	print("Correct number is:"+str(rand_num))

main()

Leave a Comment