Python Project for beginners #7| Guess The Number -Complete Code | Python for Beginners

  Рет қаралды 23,854

Jenny's Lectures CS IT

Jenny's Lectures CS IT

Күн бұрын

In this video we will make a Game Project in Python named "Guess The Number" using functions.
Best Python Tutorials for Beginners: • Python - Basic to Advance
*********************************************
Connect & Contact Me:
Jenny's Lectures HINDI: / @jennyslectureshindi
Facebook: / jennys-lectures-csit-n...
Quora: www.quora.com/profile/Jayanti...
Instagram: / jayantikhatrilamba
Twitter: / khatrijenny
*******************************************
More Playlists:
Programming in C Tutorials: • Programming in C
Printing Pattern in C: • Printing Pattern Progr...
C++ Tutorials for beginners: • Lec 1: How to Install ...
Placement Series: • Placements Series
Data Structures and Algorithms: https: • Data Structures and Al...
Design and Analysis of Algorithms(DAA): • Design and Analysis of...
Dynamic Programming: • Dynamic Programming
Operating Systems tutorials: // • Operating Systems
DBMS Tutorials: • DBMS (Database Managem...
#projects #pythonprojects #python #pythonprogramming #jennyslectures

Пікірлер: 42
@inkbythebarrelandpaperbyth6905
@inkbythebarrelandpaperbyth6905 6 ай бұрын
im glad i found this chanel!
@vasanthkumar3567
@vasanthkumar3567 Жыл бұрын
Thank you so much for sharing knowledge ❤
@sayednoorahmad8973
@sayednoorahmad8973 Жыл бұрын
Nice project❤❤❤❤
@Shantanu_lrnr
@Shantanu_lrnr 10 ай бұрын
This code is easy one... import random import logo_art def no_guesses(attempts,i): if attempts - i != 0: print('guess again') return (f"you have {attempts - i} attempts remaining to guesses the number") else: return ('you are out of guesses,you lose!!') def easy_hard(choose_num,attempts): print(f"you have {attempts} attempts remaining to guess the number!") for i in range(1,attempts + 1): guess = int(input('make a guess')) if guess > choose_num: print('your guess is too high') print(no_guesses(attempts,i)) elif guess < choose_num: print('your guess is too low') print(no_guesses(attempts,i)) else: print(f'you guess is right...The answer was {choose_num}') break print(logo_art.logo) print('let me think of a number between 1 to 50.') num_list = list(range(51)) choose_num = random.choice(num_list) while True: level = input("Choose level of difficulty...Type 'easy' or 'hard' : ") if level == 'easy': easy_hard(choose_num,attempts = 10) break elif level == 'hard': easy_hard(choose_num,attempts = 5) break else: print("you've entered wrong input,Try again")
@prabhuns1791
@prabhuns1791 Жыл бұрын
Long live ur lecture mam
@pythonassignment
@pythonassignment Жыл бұрын
i also learned python drom this channel
@Lekshmi_sree
@Lekshmi_sree Жыл бұрын
Mam .....when will you upload the c++ programming language...... please post that mam❤😮
@digi_aayu
@digi_aayu Жыл бұрын
Perfect example of brain with beuty🫣
@hirakjyotidas1944
@hirakjyotidas1944 Жыл бұрын
Racists
@varunrathour1
@varunrathour1 2 ай бұрын
ap bhi kisi se km nhi ho
@shiv_gourav
@shiv_gourav 28 күн бұрын
80✅
@puneethreddymreddy1510
@puneethreddymreddy1510 Жыл бұрын
Ma'am when this python course will complete
@chinenyeumeaku9262
@chinenyeumeaku9262 Жыл бұрын
from random import randint from L import LOGO print(LOGO) print() print("Think of a number between 1 to 50. ") while True: choice = input("Choose difficulty level... type 'easy' or 'hard': ").lower() options = ['hard', 'easy'] if choice not in options: print("Enter valid option") else: break if choice == "hard": count = 5 print(f"you have {count} attempt remaining to guess the number.") else: count = 10 print(f"you have {count} attempt remaining to guess the number.") numbertoguess = randint(30, 40) counter = False guess = int(input("Make a guess: ")) while not counter: if guess < numbertoguess: print("Your guess is too low Guess again") count = count - 1 print(f"you have {count} attempt left") elif guess > numbertoguess: print("Your guess is too high Guess again") count = count - 1 print(f"you have {count} attempt left") else: print("Your guess is right... You win") print(f"the number is {numbertoguess}") break if count == 0: counter = True print("You are out of guesses") break else: guess = int(input("Make a guess: "))
@muneebbolo
@muneebbolo 4 ай бұрын
Major steps involved in the code: Import the necessary modules: random and logo_art. Define constants for the number of attempts allowed for each difficulty level. Define a function set_difficulty that takes the chosen level (‘easy’ or ‘hard’) and returns the corresponding number of attempts. Define a function check_answer that compares the guessed number with the answer and provides feedback (too low, too high, or correct). Define the main game function game: Display a logo. Generate a random number between 1 and 50 as the answer. Ask the user to choose a difficulty level. Set the number of attempts based on the chosen level. Repeatedly prompt the user to guess a number: Display the remaining attempts. Check if the guessed number is correct or not. Update the remaining attempts. End the game if the user guesses correctly or runs out of attempts.
@vinodkumarpunna1163
@vinodkumarpunna1163 6 күн бұрын
Jenny Mam, Is there any book you follow for exercises that you make do, can you suggest me any website or book for more real time experience
@user-ee4mg3pn5g
@user-ee4mg3pn5g 5 ай бұрын
import random level=input("type 'easy' or 'hard' to choose the level: ").lower() if level=="easy": print("you have 10 attempts to guess the number between 1 to 50") attempts=10 elif level=="hard": print("you have 5 attempts to guess the number between 1 to 50") attempts=5 else: print("invalid input") number=random.randint(1,50) print(number) print(level) while (level == "easy" and attempts > 0) or (level == "hard" and attempts > 0): guess=int(input("guess a number: ")) if guessnumber: print("too high") attempts-=1 print(f"you have {attempts} attempts left") else: print("u guessed it right") break
@anurajyendhe5981
@anurajyendhe5981 9 ай бұрын
This project is mentioned in resume
@harryjamespotter9437
@harryjamespotter9437 3 ай бұрын
Kash apka channel class 12 me mil jata. 😢 Ab toh boards bhi khatam ho gye
@KavitaPatel-wo4yj
@KavitaPatel-wo4yj 8 ай бұрын
Please send the code of this project
@yeoshuabenzaken7736
@yeoshuabenzaken7736 3 күн бұрын
anyone have a sample of a flowchart?
@sandipanpasari7017
@sandipanpasari7017 Жыл бұрын
Ye course kitna din lagega aur
@DARK_RYZEN
@DARK_RYZEN 7 ай бұрын
import random print("guess the number") computer_guessed=random.randint(1,50) difficulty_level=input("enter a difficulty level 'hard' or 'easy':") if difficulty_level=="easy": print("you have 10 chances") for i in range(1,10): human_guessed_number=int(input("enter a no")) if computer_guessed==human_guessed_number: print("you are correct") break elif human_guessed_number>computer_guessed: print("your guess is more") elif human_guessed_number computer_guessed: print("your guess is more") elif human_guessed_number < computer_guessed: print("your guess is low") else: print(f"try again {4-i}")
@harshadshinde5226
@harshadshinde5226 7 ай бұрын
Easy to understand ....❤
@purpledreamers618
@purpledreamers618 Жыл бұрын
Di are you doing this project on laptop on computer please please please please please please reply me ❤ by the way thank you 😊 and lots of love from uttrakhand ❤
@JennyslecturesCSIT
@JennyslecturesCSIT Жыл бұрын
Laptop 💻
@purpledreamers618
@purpledreamers618 Жыл бұрын
Thankyou for replying ❤️
@eumm11
@eumm11 Жыл бұрын
Jenny makes me really sad to see that you don't post c++ as often... it would be so helpful to have the oop explained by someone as knowledge as you. don't think much about the views, maybe python gives a little bit more but someone that follows you would benefit much more with c++ because it can follow the c, c++ path, and then python. in the long run the views are gonna be the same or even more, but your channel becomes an even better reference given that it as all the foundational base. thank you so much, God bless you
@benstokes75499
@benstokes75499 Жыл бұрын
arre bhai itna emotional nhi hote 🤣 agar itna hi padhna hota to youtube pe itni saari video h, udhar se kr leta :)
@trichyboys2667
@trichyboys2667 Жыл бұрын
I'm confused... To observe the lesson or to admire your beauty? Thank yewww new mam !
@vaishnavisharma5728
@vaishnavisharma5728 Ай бұрын
import random num = random.randint(1,50) diff_level=input("Enter the level of difficulty...Type 'easy' or 'hard': ") if diff_level == "easy": attempts = 10 print(f"Yor have {attempts} attempts to guess the number!") elif diff_level == "hard": attempts = 5 print(f"Yor have {attempts} attempts to guess the number!") else: print("Enter valid input!") while (diff_level == "easy" and attempts > 0) or (diff_level == "hard" and attempts > 0): guess = int(input("Make a guess: ")) if attempts == 0: print("You lost") elif guessnum: print("Your guess is too high!") attempts-=1 else: print("Your guess is correct...You won!") break
@adamyagogreen
@adamyagogreen Жыл бұрын
# Assignment answer :- Ask level again, when we mistakenly typed wrong Difficulty level. print(num_logo.logo) print("Let me think of a number beetween 1 to 50.") answer= random.randint(1,50) def game(): level= input("Choose level of Difficulty--> Type 'easy' or 'hard'=").lower() attempts= set_difficulty(level) if attempts!= EASY_LEVEL_ATTEMPT and attempts!= HARD_LEVEL_ATTEMPT: print("You have entered wrong difficulty level, Play Again!") return game()
@sujinas2434
@sujinas2434 Жыл бұрын
can you share your github id or somehow add your code in the description or comment section or telechannel
@srinivasaraovooda
@srinivasaraovooda 8 ай бұрын
Guess Number is always changing if we are unable to guess.
@srinivasaraovooda
@srinivasaraovooda 8 ай бұрын
Showing error in game()
@user-ks2nq7hs5v
@user-ks2nq7hs5v 2 ай бұрын
import random attempts = 0 def easy_or_hard(): global attempts attempts -= 1 user = int(input('Make a guess: ')) while attempts > 0: if user == comp: return (f'your guess is right, Number:{comp}') if user > comp: print (f'Your guess is too high') print (f'You have {attempts} attempts Remaining') return (easy_or_hard()) if user < comp: print (f'Your guess is too low') print (f'You have {attempts} attempts Remaining') return (easy_or_hard()) return (f"You are out of guesses.. You lose Number is {comp}") comp = random.randrange(1,51) print('Welcomes to Guess a Number Game Let me think of a number between 1 to 50') level = input('Choose level of difficulty... Type(easy or hard): ').lower() if level == 'easy': attempts = 10 print (f'You have 10 attempts') print(easy_or_hard()) if level == 'hard': attempts = 5 print (f'You have 5 attempts') print(easy_or_hard())
@user-tf3fn5ki5p
@user-tf3fn5ki5p 6 ай бұрын
import random def guess_game(num,level): if level=='hard': count=5 else: count=10 flag=True i=0 while inum: print("Its too high") print("Guess Again") elif guess
@TeluguDisciplineGamers
@TeluguDisciplineGamers Жыл бұрын
Hii mam
@pranaybattu5169
@pranaybattu5169 Жыл бұрын
Do Java course
@softmedun6794
@softmedun6794 Жыл бұрын
👉👉Ma'am aapka Ghar kanha hai Ma'am aap please Hindi language me bol ke padhaye English language me problem hota hai
@adamyagogreen
@adamyagogreen Жыл бұрын
Assam, Guwahati, should I book your ticket to go there ?
@rathnakar3h131
@rathnakar3h131 5 ай бұрын
import random print("GUESS THE NUMBER!") print("let me think of a number between 1 to 50.") computer_choice=random.randint(1,50) # print(computer_choice) choose_level=input("Choose level of difficulty...Type 'easy' or 'hard':") if choose_level=='easy': lives=10 print(f"you have {lives} attempts remaining to guess the number!") elif choose_level=='hard': lives=5 print(f"you have {lives} attempts remaining to guess the number!") end=False while not end: guess=int(input("Make a guess: ")) if lives==0: end=True print("you are out of guesses.. you lose!!") elif guess>computer_choice: print("your guess is too high!") print("guess again") lives-=1 print(f'you have {lives} attempts remaining to guess the number!') elif guess
Debugging in Python | Debugging Tips | Python Tutorials for Beginners #lec81
17:22
I Made 200 Python Projects...Here Are My 5 FAVORITES
11:23
Tech With Tim
Рет қаралды 146 М.
НРАВИТСЯ ЭТОТ ФОРМАТ??
00:37
МЯТНАЯ ФАНТА
Рет қаралды 8 МЛН
路飞太过分了,自己游泳。#海贼王#路飞
00:28
路飞与唐舞桐
Рет қаралды 35 МЛН
Super Simple Python: High Low Guessing Game
2:01
Yujian Tang
Рет қаралды 2,2 М.
Please Master These 10 Python Functions…
22:17
Tech With Tim
Рет қаралды 108 М.
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
Sahil & Sarra
Рет қаралды 631 М.
Let's code a beginner's Python BANK PROGRAM 💰
15:01
Bro Code
Рет қаралды 127 М.
Python Special Programs - Number Guessing Game
13:16
Neso Academy
Рет қаралды 9 М.
5 Quick Python Projects for Beginners (finish in one day)
48:20
Internet Made Coder
Рет қаралды 35 М.
5 Mini Python Projects - For Beginners
1:41:08
Tech With Tim
Рет қаралды 2,8 МЛН
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 287 М.