Hangman Game in Python | Python Project #3 | Python Project for beginners

  Рет қаралды 73,047

Jenny's Lectures CS IT

Jenny's Lectures CS IT

Күн бұрын

Пікірлер: 110
@lifebyvikk6751
@lifebyvikk6751 Жыл бұрын
I just like how you break complex problems into small problems in order to have them solved,, the way you pause and think and write code is very helpful for someone who wants to really learn how to solve programming problems not only in python but any language for that matter! Thank you Jenny!
@BCKSPCEMusic
@BCKSPCEMusic Жыл бұрын
Well this was really crazy in a good way, i don't know if this channel is for explaining kids but i am 24years old & enjoying it
@Arceus948
@Arceus948 Жыл бұрын
Mam pls start machine learning Playlist, i beg u 😭😭🙏🏻🙏🏻🙏🏻
@santhoshk2722
@santhoshk2722 Жыл бұрын
I'm also waiting for that
@jyoth2009
@jyoth2009 Жыл бұрын
Yes mam
@ShivamSingh-ez5dc
@ShivamSingh-ez5dc Жыл бұрын
Yes
@lifebyvikk6751
@lifebyvikk6751 Жыл бұрын
I think she has already done a superb job teaching python, I would probably master python well first if I were you
@Arceus948
@Arceus948 Жыл бұрын
@@lifebyvikk6751 i have already mastered python bro, now i want to learn ML
@subratkumarsahoo1946
@subratkumarsahoo1946 10 ай бұрын
waah didi waaah..waah didi waah...what an explanation?
@tmurari9452
@tmurari9452 Жыл бұрын
Mam please tell how to draw this Hangman pictures
@shivateja3123
@shivateja3123 Жыл бұрын
just subscribed and started watching
@sachinwankhede3346
@sachinwankhede3346 9 ай бұрын
8:48 match expressions😊
@munamarziya2546
@munamarziya2546 Жыл бұрын
Ma'am you better start your own college,,,,,,i am from non cs branch,,,,,you will get me and my friends as students for sure 🥺
@santhoshk2722
@santhoshk2722 Жыл бұрын
I'm also
@ishanpandey9369
@ishanpandey9369 2 ай бұрын
00:04 Creating a Hangman game in Python 02:32 Generating and displaying a random word in Hangman game 07:50 Comparison of guessed letters with chosen word 10:30 Using a while loop for the Hangman game 15:55 Handling user input for Hangman game in Python. 18:13 Decrease life count by 1 for every wrong guess 23:03 Troubleshooting and correction of code errors 25:23 Understanding the stages and lives in Hangman game 30:01 Modify the Hangman project according to your preferences Crafted by Merlin AI.
@ObulshettySrikari
@ObulshettySrikari Жыл бұрын
Mam instead of making an empty list can we write for i in chosen_list: print("_", end=" ") Will we get blanks mam??
@sushantprasai-m5w
@sushantprasai-m5w Жыл бұрын
display = ['_']*len(chosen_word) #This will do your job
@Khan_aamir.
@Khan_aamir. 7 ай бұрын
Thank you so much mam😊😊😊😊
@yogendrathakur8053
@yogendrathakur8053 Жыл бұрын
Very good 🎉😂
@glps369
@glps369 Жыл бұрын
Thank You So Much
@ruhulameem1397
@ruhulameem1397 Жыл бұрын
Hello mam mam please make video on numpy, matplotlib, and pandas library of python because i am preparing as a data analytics and these library is necessary for being data analytics ur concept and way of teaching is very elegant and fabulous i learn data structures from your tutorial and suggest my junior to watch your video of DSA please mam make video on these library tl thank you
@ngsscofficial
@ngsscofficial 5 ай бұрын
THANK YOU SO MUCH MAAM
@TSHILIDZI_MUNYAI
@TSHILIDZI_MUNYAI Жыл бұрын
How to u code the figure? The hangman stages that u just imported
@-SakuraNoHana-
@-SakuraNoHana- 6 ай бұрын
Hello ma'am, Can you please make a video on python import time? I would really appreciate it. Thank you!
@nityamittal6759
@nityamittal6759 Жыл бұрын
Mam can you make a playlist on asymptotic notation pls😃😃😃
@Harsha.108
@Harsha.108 4 ай бұрын
for example, the choosed word is "krishna" suppose we typed 'a', guess is correct, 'a' is present in 'krishna' and a is filled in blank list, no lives lost but if we type 'a' again, next time... same happens,, but we should lose one life,, because one 'a' present in 'krishna' is already filled.. there is no another 'a'
@kirankumar-pv1yy
@kirankumar-pv1yy Жыл бұрын
Mam please Start Java Classes
@RishabhChatterjee-fg2gz
@RishabhChatterjee-fg2gz Жыл бұрын
Ma'am I'm currently studying in 1st year of diploma in computer science and technology and my dream is to give gate exam and python is my favorite language and I don't want to do any job , I want to be a data scientist professional and want to research about data science field like machine learning, deep learning, artificial intelligence, etc.. I have a question what is big data? and I want to say you to make this course as a professional python developer
@mzxrex9381
@mzxrex9381 Жыл бұрын
Mam where should i run this code In jupyter notebook or vs code
@Praveen_C11
@Praveen_C11 5 ай бұрын
Vs is better
@akhil2721
@akhil2721 Жыл бұрын
Mam its a humble request please start c++, I have c++ in my 3 rd sem and currently i am in 2nd sem , so i will need it in 3rd sem .
@incomparablevikkie5507
@incomparablevikkie5507 Ай бұрын
How did you draw the images
@Shashank1703
@Shashank1703 Жыл бұрын
Mam Do one video on Java Programming Basics
@MARUTHU_1801
@MARUTHU_1801 4 ай бұрын
where we can download the hangman stages Madam? is it available in the internet?
@omkarmurala2084
@omkarmurala2084 Жыл бұрын
Like u said we can make this hangman game in multiple ways can u please elaborate so that we can understand
@amitkmpbtup
@amitkmpbtup Жыл бұрын
IT DOESNT WORK WHEN U DO THE HANGMAN STGES IT IS SHOWING OUT OF INDEX WHEN I RUN IT PLS HELP
@SaimaArif-n9w
@SaimaArif-n9w Жыл бұрын
In the program of hangman game you have not defined lives. Your program is not showing name error for lives but mine is showing name error. please clear it mam
@mahjabeen5806
@mahjabeen5806 2 ай бұрын
she did
@ChildhoodForever1808
@ChildhoodForever1808 Жыл бұрын
Ma'am I am currently in 1st year of btech and I want to prepare for gate. When do you think I should start preparing for it please tell me 🙏
@rauhan_sheikh
@rauhan_sheikh Жыл бұрын
for the 1st 2-3 years focus on learning and building projects and also do internship in the 3rd year and based on that decide if you have to or want to do gate or not. if you decide you have better opportunities already because you have built good projects and have proof of work then leave it else if you still want to pursue gate then start. 1 and half year of dedicated preparation is good enough for gate.
@lakshmivaddi4395
@lakshmivaddi4395 7 ай бұрын
hello mam,i have a doubt..suppose one word has two or three same letters like example swiss.if we guess a lettter s from word it should placed only one s.. right ?but in our program at a time three 3 S are placed in display..only one letter should be placed by one chance.please clarify my doubt mam
@hunterxcobby
@hunterxcobby 3 ай бұрын
no please it can display all the s in the chosen word
@VenkateshAnnabathina
@VenkateshAnnabathina 5 ай бұрын
#need machine learning playlist
@burragallaneeraj8136
@burragallaneeraj8136 Жыл бұрын
Please provide code in the description
@systembreaker4864
@systembreaker4864 Жыл бұрын
Mam this has one problem that is if we enter correct letter again in the input it will not take lives it's like we can run this continuously until the whole list of "_" these characters is replaced with letters
@Taekookbelieverr
@Taekookbelieverr 4 ай бұрын
Can we add levels to this game like low level, medium level, hard level
@SriRam-in2zv
@SriRam-in2zv 8 ай бұрын
In Python 3.12, it is showing the hangman_stages function is not compatible. Please let me know if there is any other function which can be used in 3.12
@georgevincent93
@georgevincent93 6 ай бұрын
it is not an inbuild function it is another python file she created naming "hangman_stages"
@bandikomalkumar8066
@bandikomalkumar8066 Жыл бұрын
What is meant by "Scratch file" which is displayed at top left corner of "Pycharm" application under pythonProject~New~Scratch File. Please 🥺 mam!
@Praveen_C11
@Praveen_C11 5 ай бұрын
Scratch file is just like any other file types like python file or html file or text file. Scratch is the most basic programming language one can learn, usually taught to kids in school. Pycharm has Scratch file as it's default file like how notepad has text file as default, u can change it to python by saving it with .py extension or as text file with .txt extension
@braveheart3176RTY
@braveheart3176RTY 8 ай бұрын
hello im rhey from philippines
@sonusonu-m5u
@sonusonu-m5u 2 ай бұрын
😊
@g.viswnathreddy1869
@g.viswnathreddy1869 Жыл бұрын
Mam ,provide notes in description please 😊😊
@kalyanitamanampudi
@kalyanitamanampudi 9 ай бұрын
Plzz mam start the classes of data science alsoo
@abishakthd6884
@abishakthd6884 Жыл бұрын
I love you 😍 💗 mam
@marieswaran8124
@marieswaran8124 Жыл бұрын
Hi Madam, I have doubt in this session, How did you add display variable(list data type) with '_' string. Because those are different data type. Can you provide the answer for this doubt.
@rameshamma6497
@rameshamma6497 Жыл бұрын
The list contains an empty string, we are just concatenation with another string.
@bestvideos9088
@bestvideos9088 10 ай бұрын
But how you make hangman_stages?
@sciencetechy8058
@sciencetechy8058 2 ай бұрын
import random import list select=random.choice(list.char) lives=6 count=0 diplay=[] for i in range(len(select)): diplay +='_' #print(select) print(diplay) gameover=False while not gameover: guess=input("enter the word ").lower() for index in range(len(select)): letter=select[index] if letter== guess: diplay[index]=guess print(diplay) if guess not in select: lives -= 1 print(f"you left {lives} now") if lives == 0: gameover=True print("You Lose") if '_' not in diplay: gameover=True print("You Win") small change is if u get a Warning about lives is good for out put like 6,5,4,3,2,1,lose
@yogalakshmipabbisetty5966
@yogalakshmipabbisetty5966 Жыл бұрын
Mam could u plz start java
@Bodigajohnygoud
@Bodigajohnygoud Жыл бұрын
mam what if a user enter's a correct word repeatedly??
@Lucky_truth
@Lucky_truth Жыл бұрын
import random print("WELCOME TO HANGMAN") heart=6 won=False list1= ["lamp", "chair", "book", "spoon", "tree", "hat", "bike", "door", "pen", "cup", "shoe", "clock", "ball", "table", "sun", "moon", "flower", "bridge", "cloud", "pillow"] # random words word=random.choice(list1)#choose a random word from the list word=list(word)#make it in to list again output = ["_"] * len(word) print(output) while heart: guess=input("Guess a letter") for i in range(len(word)): if(guess==word[i]): output[i]=guess print(output) if(output==word): won=True print("you won!") if (guess not in word): heart -= 1 print(f"You have {heart} heart left") if(won==True): break if(heart==0): print(f"The word is {word}")
@harshachaukyareddy1341
@harshachaukyareddy1341 Жыл бұрын
Excellent..💫
@vaibhavichanne6666
@vaibhavichanne6666 Жыл бұрын
guess=input("Guess a letter").lower()
@jjjmemes420
@jjjmemes420 6 ай бұрын
Super bro..... ❤❤
@Chandu_SKY
@Chandu_SKY 10 ай бұрын
Hangman module not found error mam
@abhileswar
@abhileswar 11 ай бұрын
type error = showing cannot concatenate list (not "str") to list , in line display = display + '_' , mam can u explain this problem
@avenger1898
@avenger1898 3 ай бұрын
mam but i am unable to print the STAGES
@NARENDRAPAGOTI
@NARENDRAPAGOTI Жыл бұрын
mam please teach us java too
@utkarsh_aa786
@utkarsh_aa786 Жыл бұрын
Maam I am just pass class 12th with( PCM) but ab Samajh nhi aa rha Iska kya 🤔kru?
@NikiNoName-cy6lo
@NikiNoName-cy6lo Ай бұрын
Guys I need to use IDLE. Like at school we need to put IDLE into python and then we get an empty file. Would her code also work on the system we use in school. I’m going to have an exam where we have to do this in python. Please help
@mattapallichandrashekar8947
@mattapallichandrashekar8947 Жыл бұрын
Mam please start Java play list
@-NChandana-pm9hb
@-NChandana-pm9hb Жыл бұрын
No module named hangman_stages
@muneebbolo
@muneebbolo 10 ай бұрын
Here's what each part of the code does: 1. **Imports and Initial Setup** import random import hangman_stages import words_file ``` These lines import the necessary modules for the game. `random` is a built-in Python module for generating random numbers. `hangman_stages` and `words_file` are custom modules that contain the hangman stages and the word list, respectively. 2. **Game Variables** lives=6 chosen_word=random.choice(words_file.words) print(chosen_word) ``` Here, the variable `lives` is set to 6, representing the number of incorrect guesses the player is allowed. `chosen_word` is a randomly selected word from the word list in `words_file`. This word is what the player has to guess. 3. **Display Setup** display=[] for i in range(len(chosen_word)): #0 1 2 3 4 display +='_' print(display) ``` This code creates a list `display` that is used to show the player's progress in guessing the word. It starts as a list of underscores, with one underscore for each letter in `chosen_word`. 4. **Game Loop** while not game_over: letter_guess = input('Guess the letter ').lower() # r for position in range(len(chosen_word)): letter=chosen_word[position] if letter==letter_guess: display[position] = letter_guess print(display) ``` This is the main game loop. The player is asked to guess a letter, which is then checked against each letter in `chosen_word`. If the guessed letter is in the word, the corresponding underscore in `display` is replaced with the letter. 5. **Lives and Game Over Conditions** if letter_guess not in chosen_word: lives -= 1 if lives == 0: game_over = True print('Game Over, You Lose! ') if '_' not in display: game_over = True print('You win!! ') print(hangman_stages.stages[lives]) ``` If the guessed letter is not in the word, the player loses a life. If all lives are lost (`lives == 0`), the game ends and the player loses. If there are no more underscores in `display`, meaning the player has guessed all the letters, the game also ends and the player wins. After each guess, the current hangman stage is printed based on the number of remaining lives.
@jyoth2009
@jyoth2009 Жыл бұрын
Mam uploaded more and more python videos please
@everythingwithanirudha
@everythingwithanirudha Жыл бұрын
mam quality to improve karo, like camera or iphone, or may be the compression is bit high
@shahiddar9852
@shahiddar9852 Жыл бұрын
Mam can you please send me the details how to make a website I want to make a website
@nikhils__2808
@nikhils__2808 Ай бұрын
import random a = ['hand', 'cobra', 'elbow', 'dog', 'snake', 'copy', 'subway', 'key'] word = random.choice(a) # print(word) print(f'Number of letter in word = {len(word)}, {word}') list1 = [] for i in range(len(word)): list1 += '_' lives = 6 game_over = False while not game_over: guess_l = input("Enter word letter: ").lower() for i in word: if i == guess_l: letter = word.index(guess_l) list1[letter] = guess_l print(list1) if guess_l not in word: lives -= 1 if lives == 0: game_over = True print("You Lose!") if '_' not in list1: game_over = True print("You Win!!")
@georgevincent93
@georgevincent93 6 ай бұрын
import random fruits = ["apple", "banana", "orange", "grape", "kiwi", "strawberry", "watermelon", "pineapple", "blueberry", "mango", "pear", "peach", "plum", "cherry", "raspberry", "blackberry", "lemon", "lime", "coconut", "pomegranate", "apricot", "fig", "nectarine", "cranberry", "grapefruit", "tangerine", "lychee", "dragonfruit", "guava", "passionfruit", "melon", "persimmon", "kiwifruit", "cantaloupe", "honeydew", "date", "papaya", "jackfruit", "elderberry", "starfruit", "rhubarb", "boysenberry", "carambola", "kumquat", "soursop", "ackee", "breadfruit", "durian", "longan", "tamarind", "mulberry", "plantain", "quince", "soursop", "uglifruit"] guess=random.choice(fruits) length=len(guess) list1=[] for i in range(length): list1.append("-") print(list1) flag=0 n=0 while('-' in list1 and n!=6): x=input("guess the alphabet ") for i in range(length): if guess[i]==x: flag=1 list1[i]=x if(flag==1): print(list1) print("correct") if(flag==0): n+=1 print(list1) print("incorrect") print(f"you lose {n} life") flag=0 if '-' in list1: print(f"the correct answer was {guess}") print(" you lose the game") else: print(" you win the game")
@sharifullahsalarzai
@sharifullahsalarzai Жыл бұрын
Mam please complete c++ videos
@tech_gaming889
@tech_gaming889 Жыл бұрын
Mam we want emcet online classes
@THEoneandonlystika
@THEoneandonlystika Жыл бұрын
here for beauty
@gangabankala7745
@gangabankala7745 Жыл бұрын
Madam please make sure send notes in description madam please it's my humble request 😢😢😢
@narendrakota890
@narendrakota890 Жыл бұрын
Third👍
@Rayray-cd3sz
@Rayray-cd3sz Жыл бұрын
# without figure and alternatives which are commented import random list_1 = ["apple", "banana", "cherry", "avocado", "kiwi", "jackfruit"] task_1 = random.choice(list_1) # list_2 = [] print("Guess name of the fruit ! ") #for dash in task_1: #list_2.append("_") # list_2 += "_" hidden_word = ["_"] * len(task_1) # print(hidden_word) is a list of strings print("".join(hidden_word)) # strings joined # print(hidden_word) remains a list of strings attempts = 0 no_of_guesses = 6 guessed_letter = set() while "_" in hidden_word and attempts < no_of_guesses: guess = input("Guess a letter of the word: ") if len(guess) != 1: print("Enter a single letter at a time! ") elif guess in guessed_letter: print("Already guessed, life reduced !") attempts += 1 print(f"{no_of_guesses - attempts} lives remaining") else: guessed_letter.add(guess) if guess in task_1: for i in range(len(task_1)): # for i, letter in enumerate(task_1): if task_1[i] == guess: # if letter == guess and hidden_word[i] == "_": hidden_word[i] = guess # print(hidden_word) print("".join(hidden_word)) else: attempts += 1 print(f"You have {no_of_guesses - attempts} guess left.") if "_" not in hidden_word: print("Congratulation, you have guessed the word") else: print(f"Your chances are over, the correct word is {task_1}")
@lovekushrajput442
@lovekushrajput442 Жыл бұрын
Third😄😄😄😂
@Viki.A1
@Viki.A1 Жыл бұрын
💞👍👍👍
@jincejolly2791
@jincejolly2791 3 ай бұрын
import random word=["banana","orange","apple","carrot"] select=random.choice(word) selected=list(select) lenth=len(selected) underword=[] life=6 for i in range(lenth): underword.append("_") j=True while j==True: gues=input("Guess the letter: ") if gues in selected: d=selected.index(gues) underword[d]=gues selected.pop(d) selected.insert(d,"#") if(underword.count("_")==0): print("Congrats You won the game") j=False print(underword) break; else: j=True print(underword) print("Your remaining life is",life) else: if(life==0): print("You loose the game") j=False break; else: life-=1 j=True print(underword) print("Your remaining life",life)
@abishakthd6884
@abishakthd6884 Жыл бұрын
Mam u r so very beautiful
@vaibhavpatharkar6794
@vaibhavpatharkar6794 Жыл бұрын
Madam iff possible pl use hindi or mixed lang
@avenger1898
@avenger1898 3 ай бұрын
#doing a hangaman game player1=list(input("ENTER A WORD:")) #print(player1) l=len(player1) word=list() for i in range(l): word.append('-') #print(word) print("YOU CAN GUESS ONLY \"6\" TIMES") count=0 guess="" while(count
@avenger1898
@avenger1898 3 ай бұрын
#doing a hangaman game player1=list(input("ENTER A WORD:")) #print(player1) l=len(player1) word=list() for i in range(l): word.append('-') #print(word) print("YOU CAN GUESS ONLY \"6\" TIMES") count=0 guess="" while(count
@RouMuanNgaihte
@RouMuanNgaihte Жыл бұрын
First
@nithinvasamsetti
@nithinvasamsetti 6 ай бұрын
🥵🥵🥵
@Mesomeone7298
@Mesomeone7298 Жыл бұрын
thanks mam if you can please send us your source code Thank you
@kirugaming6603
@kirugaming6603 Жыл бұрын
Mam vs code me karo code ko .......
@atmasgamingyt3168
@atmasgamingyt3168 Жыл бұрын
Second
@shivaojha6760
@shivaojha6760 Жыл бұрын
Mam I am a student of MITS Gwalior please help me python language
@Arceus948
@Arceus948 Жыл бұрын
Python language is non living thing bruh, how it can help u 😢😢😭😭
@maradanavivek2386
@maradanavivek2386 Жыл бұрын
​@@Arceus948😂😂😂😂
@wownoob-hp9pp
@wownoob-hp9pp Жыл бұрын
come to pakistan.
@adhitya001
@adhitya001 Жыл бұрын
Zero
@coding_with_bf
@coding_with_bf Жыл бұрын
Mam 😢
@ravana194
@ravana194 Жыл бұрын
Mam will you marry me 😊😊
@shaniskshanigamer4085
@shaniskshanigamer4085 Жыл бұрын
Hlo mam
@SarathReddyKakarla
@SarathReddyKakarla 3 ай бұрын
# hangman game import random print("WELCOME TO HANGMAN") heart=6 won=False list1= ["lamp", "chair", "book", "spoon", "tree", "hat", "bike", "door", "pen", "cup", "shoe", "clock", "ball", "table", "sun", "moon", "flower", "bridge", "cloud", "pillow"] # random words word=random.choice(list1)#choose a random word from the list word=list(word)#make it in to list again output = ["_"] * len(word) print(output) while heart: guess=input("Guess a letter") for i in range(len(word)): if(guess==word[i]): output[i]=guess print(output) if(output==word): won=True print("you won!") if (guess not in word): heart -= 1 print(f"You have {heart} heart left") if(won==True): break if(heart==0): print(f"The word is {word}") WELCOME TO HANGMAN ['_', '_', '_'] Guess a lettert ['_', '_', 't'] Guess a letterr You have 5 heart left Guess a lettere You have 4 heart left Guess a lettere You have 3 heart left Guess a letterr You have 2 heart left Guess a letterr You have 1 heart left Guess a lettert ['_', '_', 't'] Guess a lettera ['_', 'a', 't'] Guess a letterh ['h', 'a', 't'] you won!
Functions in Python | Introduction | Python for beginners #lec56
24:07
Jenny's Lectures CS IT
Рет қаралды 157 М.
tldraw computer introduction
32:56
tldraw
Рет қаралды 3,6 М.
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 44 МЛН
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
Fastest Way to Learn ANY Programming Language: 80-20 rule
8:24
Sahil & Sarra
Рет қаралды 929 М.
While Loop in Python | Python Tutorials for Beginners #lec50
26:51
Jenny's Lectures CS IT
Рет қаралды 90 М.
Let's code a HANGMAN GAME in Python! 🕺
25:07
Bro Code
Рет қаралды 21 М.
Hangman Game for beginners |Introduction | Python Project for beginners #lec53
8:04
12 Beginner Python Projects - Coding Course
3:00:29
freeCodeCamp.org
Рет қаралды 4,5 МЛН
File Handling in Python | Python Tutorials for Beginners #lec95
45:32
Jenny's Lectures CS IT
Рет қаралды 112 М.
How To Create Hangman Game in Python | Python Project Ideas
19:57
Hangman Game for beginners |Flowchart | Python Project for beginners #lec54
5:02
Jenny's Lectures CS IT
Рет қаралды 36 М.
5 Mini Python Projects - For Beginners
1:41:08
Tech With Tim
Рет қаралды 2,9 МЛН
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 44 МЛН