From ee591376e9a7e2206b4e0c4dfed4d46047d466a2 Mon Sep 17 00:00:00 2001 From: SAM <73647831+samhackathon@users.noreply.github.com> Date: Tue, 31 Oct 2023 13:30:45 +0500 Subject: [PATCH] Delete random.py --- random.py | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 random.py diff --git a/random.py b/random.py deleted file mode 100644 index 4483cc1a898..00000000000 --- a/random.py +++ /dev/null @@ -1,44 +0,0 @@ -import random -import math -# Taking Inputs -lower = int(input("Enter Lower bound:- ")) - -# Taking Inputs -upper = int(input("Enter Upper bound:- ")) - -# generating random number between -# the lower and upper -x = random.randint(lower, upper) -print("\n\tYou've only ", - round(math.log(upper - lower + 1, 2)), - " chances to guess the integer!\n") - -# Initializing the number of guesses. -count = 0 - -# for calculation of minimum number of -# guesses depends upon range -while count < math.log(upper - lower + 1, 2): - count += 1 - - # taking guessing number as input - guess = int(input("Guess a number:- ")) - - # Condition testing - if x == guess: - print("Congratulations you did it in ", - count, " try") - # Once guessed, loop will break - break - elif x > guess: - print("You guessed too small!") - elif x < guess: - print("You Guessed too high!") - -# If Guessing is more than required guesses, -# shows this output. -if count >= math.log(upper - lower + 1, 2): - print("\nThe number is %d" % x) - print("\tBetter Luck Next time!") - -# Better to use This source Code on pycharm!