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(9)

Ankit0651 11 months ago
Hii
harry 5 months, 3 weeks ago
Hey ankit
SachinJ 9 months, 3 weeks ago
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 9 months, 2 weeks ago
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 5 months, 3 weeks ago
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 4 months, 1 week ago
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
GaziAbbas 1 month, 3 weeks ago
# Gues the Number guesno = 14 chance = 9 isSucess = False while (chance > 0): print("You Have ",chance," Chance to Gues the No") userno = int(input("Gues Number: ")) chance = chance - 1 if userno == guesno: isSucess = True break else: if (userno > guesno): gap = userno - guesno if gap <= 5: print("Thoda Number Kam Karo Bhai") else: print("Number Kam Karo Bhai") else: gap = guesno - userno if gap <= 5: print("Thoda Number Badhav Bhai") else: print("Number Badhav Bhai") if isSucess: print("You Win This Game") else: print("Game Over")
Susheel 1 month, 3 weeks ago
#Susheel Sharma while(1): i=int(input("enter ur number")) if i>n and guess!=1: print("ur number is greater") guess=guess-1 print("ur r left with chance= ",guess) continue elif i<n and guess!=1: print("ur number is lesser ") guess=guess-1 print("ur r left with chance= ", guess) continue elif i==n: print("ur guess in correct") break else: print("ur chances are over") break
Vivek-Mishra 1 week, 5 days ago
Thanks, Harry Bhai for Awesome Tutorials |:::::::::::::::::| Full Notes and Source Code :::::::::::::} https://github.com/Optimized-World/Complete-Python-Tutorial-and-Notes

Resources

No downloadable resources for this video. If you think you need anything, please post it in the QnA!

Course Announcements

Any Course related announcements will be posted here

Course Content