Python Exercise 3 - Guess The Number

Code file as described in the video

# list1 = [ ["Harry", 1], ["Larry", 2],
#           ["Carry", 6], ["Marie", 250]]
# dict1 = dict(list1)
#
# for item in dict1:
#     print(item)
# for item, lollypop in dict1.items():
#     print(item, "and lolly is ", lollypop)
items = [int, float, "HaERRY", 5,3, 3, 22, 21, 64, 23, 233, 23, 6]

for item in items:
    if str(item).isnumeric() and item>=6:
        print(item)



Comments(6)

Ankit0651 at 2019-06-23 09:30:09 says
Hii
harry at 2019-06-23 09:30:09 says
Hey ankit
SachinJ at 2019-06-23 09:30:09 says
n= 18 while(True): a= input("enter the number") if int(a)<18: print("input is smaller") continue elif int(a)>18 : print("input is bigger") else: print("correct", int(a) ) break
mmishra at 2019-06-23 09:30:09 says
num = 18 actaulattempt = 5 attempt = actaulattempt while attempt > 0: question = "Enter number to guess " + str(attempt) + " attempt remain:" print(question, end=" ") inputnum = int(input()) if inputnum > num : print("your guess number is greater then actual number") elif inputnum < num: print("your guess number is lesser then actual number") else: print("You won, you guess correct number in ",((actaulattempt-attempt)+1)," attempt") break attempt = attempt - 1; print("Game over, you not guess correct number")
Robin at 2019-06-23 09:30:09 says
n = 16 num_of_Guess = 5 for i in range(num_of_Guess): num = int(input("Enter your number: ")) if num == n: print("You guessed right its ", n) break elif num + 2 == n or num - 2 == n or num + 1 == n or num - 1 == n: print("You are really close") else: num_of_Guess = num_of_Guess - 1 print("Incorrect! try again") continue
Manav_Seng at 2019-06-23 09:30:09 says
Name: Manav Sengupta Solution: # Code with Harry Excercise 3 -- Guess the Number Number = 56 No_of_Guesses=9 while(True): if(No_of_Guesses<1): temp2=int(input(("Game Over! Enter 1 to Continue else Enter anything"))) if(temp2!=1): break No_of_Guesses=9 guess=int(input("Enter your guess\n")) if(guess != Number): No_of_Guesses=No_of_Guesses-1 temp= guess>Number if(temp): verdict="Greater" else: verdict="Lesser" print("Your Guess is "+verdict+" than the Number\n") continue else: print("Congratulations! You got it Right!") break print(147*"*"+"\n*"+145*" "+"*\n*"+9*" "+"Thanks for checking out my code, and a ton of thanks to CodewithHarry Channel for all the Quality Content for Free"+22*" "+"*\n*"+145*" "+"*\n"+147*"*") # Gratitude