How To Make A Rock Paper Scissors Game in Python | Python Project Ideas

  Рет қаралды 10,781

NPStation

NPStation

Күн бұрын

Пікірлер: 40
@AyoItzBlu
@AyoItzBlu 2 жыл бұрын
my dad reccomended this channel for coding because he said it would be good. now I'm really thankful he recommended it. thanks for the tutorials!
@ubuntunux
@ubuntunux 2 жыл бұрын
Thank you very much. I found like this tutorial for my young daughter. I'll try this.
@lilarreola27
@lilarreola27 3 жыл бұрын
Cant wait for your next python upload! 🤩 Your python projects are so fun and i learn alot from them.
@NPStation
@NPStation 3 жыл бұрын
Glad you like them! I just published a new video on How to code a Tic Tac Toe game in Python. Do check it out.
@lilarreola27
@lilarreola27 3 жыл бұрын
@@NPStation Awesome! I definitely will check it out as soon as i get a chance!
@nehanargotra3219
@nehanargotra3219 2 жыл бұрын
@@lilarreola27 Ok
@yourelol6638
@yourelol6638 3 жыл бұрын
Never give up and keep going!:)
@NPStation
@NPStation 3 жыл бұрын
Thanks for supporting always ❤️
@gabemuse3430
@gabemuse3430 2 жыл бұрын
Help! if user_input =="rock" and computer_pick == "scissors": NameError: name 'computer_pick' is not defined. Did you mean: 'computer_wins'?
@sumemafatima6394
@sumemafatima6394 3 жыл бұрын
Wow 😳😲 this is awesome 😻
@sarahparker7497
@sarahparker7497 3 жыл бұрын
She is awesome ❤️
@gallahant
@gallahant 2 жыл бұрын
I have an assignment that asks to code this game but i have to ensure that if the user inputs a wrong value, the program will have to tell the user "Wrong value. Please input rock, paper or scissors" (and then go to the user input line) and i don't know where to place this command. Can anyone help?
@CryptoDexter777
@CryptoDexter777 2 жыл бұрын
great video , how to add best out of 3 feature in it. if user or computer win the game 2 time out of 3 it should end the code ? i hope you are getting my point
@NPStation
@NPStation 2 жыл бұрын
Good idea, and thanks for the suggestion. I can enhance the code and will send you.
@littleglitch5853
@littleglitch5853 3 жыл бұрын
I like it :)
@karmavibes7148
@karmavibes7148 3 жыл бұрын
Awesome, but can u also give a tutorial in visual studio code
@NPStation
@NPStation 3 жыл бұрын
You can use the same code in VS as well. Try it and let me know.
@hometv5043
@hometv5043 2 жыл бұрын
For tie you could have made another elif if user choice ==computer pick it is a tie , but this is a nice simple easycode , there are lot of other videos also , this logic of creating is simple to the point
@NPStation
@NPStation 2 жыл бұрын
Good point!
@pramodnarwade9151
@pramodnarwade9151 3 жыл бұрын
Teach me Master!
@purnachandra181
@purnachandra181 3 жыл бұрын
@NP Station , Pls help me out , Whenever I run the my code it shows : "computer_pick = options[random_numbers] IndexError: list index out of range" Solutions Pls
@NPStation
@NPStation 3 жыл бұрын
Send me your code. I can help you.
@purnachandra181
@purnachandra181 3 жыл бұрын
@@NPStation My code is below pls check : import random user_wins = 0 computer_wins = 0 options = ["Rock", "Paper", "Scissors"] while True: user_input = input("Type Rock/Paper/Scissors or Q for Quit : ").lower() if user_input == "Q" or "q": break print("You won", user_wins, "time.") print("The computer won", computer_wins, "time.") print("Bye") if user_input not in options: continue random_numbers = random.randint(1, 3) # Rock : 1, Paper : 2, Scissors : 3 computer_pick = options[random_numbers] print("Computer picked", computer_pick + "-") if user_input == "Rock" and computer_pick == "scissors": print("you Won!!") user_wins += 1 elif user_input == "Paper" and computer_pick == "Rock": print("you Won!!") user_wins += 1 elif user_input == "Scissors" and computer_pick == "paper": print("you Won!!") user_wins += 1 else: print("You Lost") computer_wins += 1 print("You won", user_wins, "time.") print("The computer won", computer_wins, "time.") print("Bye") import random user_wins: int = 0 computer_wins = 0 options = ["Rock", "Paper", "Scissors"] while True: user_input = input("Type Rock/Paper/Scissors or Q for Quit : ").lower() if user_input == "Q" or "q": break print("You won", user_wins, "time.") print("The computer won", computer_wins, "time.") print("Bye") if user_input not in options: continue random_numbers = random.randint(1, 3) # Rock : 1, Paper : 2, Scissors : 3 computer_pick = options[random_numbers] print("Computer picked", computer_pick + "-") if user_input == "Rock" and computer_pick == "scissors": print("you Won!!") user_wins += 1 elif user_input == "Paper" and computer_pick == "Rock": print("you Won!!") user_wins += 1 elif user_input == "Scissors" and computer_pick == "paper": print("you Won!!") user_wins += 1 else: print("You Lost") computer_wins += 1 print("You won", user_wins, "time.") print("The computer won", computer_wins, "time.") print("Bye") user_wins: int = 0 computer_wins = 0 options = ["Rock", "Paper", "Scissors"] while True: user_input = input("Type Rock/Paper/Scissors or Q for Quit : ").lower() if user_input == "Q" or "q": break print("You won", user_wins, "time.") print("The computer won", computer_wins, "time.") print("Bye") if user_input not in options: continue random_numbers = random.randint(1, 3) # Rock : 1, Paper : 2, Scissors : 3 computer_pick = options[random_numbers] print("Computer picked", computer_pick + "-") if user_input == "Rock" and computer_pick == "scissors": print("you Won!!") user_wins += 1 elif user_input == "Paper" and computer_pick == "Rock": print("you Won!!") user_wins += 1 elif user_input == "Scissors" and computer_pick == "paper": print("you Won!!") user_wins += 1 else: print("You Lost") computer_wins += 1 print("You won", user_wins, "time.") print("The computer won", computer_wins, "time.") print("Bye")
@NPStation
@NPStation 3 жыл бұрын
Hello Purna, I ran your code and your list range was out of index. You had written (1, 3) but you need to write (0, 2) since it starts on 0, not 1. Also another problem was that you put: if user_input == "Q" or "q". You need to delete the( "Q" or )since you have already added the .lower() in the previous line. I hope this helps! :)
@purnachandra181
@purnachandra181 3 жыл бұрын
​@@NPStationSorry to disturb again but I have made the changes and the error problem is resolved but now its showing me the wrong output like if I picked rock and computer picked scissor , then also it shows me "You lost , Cmputer won 1 time​
@purnachandra181
@purnachandra181 3 жыл бұрын
solutions pls genius
@Lilac_cloud1234
@Lilac_cloud1234 2 жыл бұрын
neha actually its not working in idle.....its showing invalid syntax.....can u make a vid on it pls....
@NPStation
@NPStation 2 жыл бұрын
Can you share the screenshot of the error please?
@AmTheFireman
@AmTheFireman 3 жыл бұрын
Wow
@Kettlewhat21
@Kettlewhat21 Жыл бұрын
When I make my own move the conputer doesn't even respond it just says the first line again. Here is my code: import random
@NPStation
@NPStation Жыл бұрын
Can you send me your entire code so I can take a look?
@marshmallo9014
@marshmallo9014 3 жыл бұрын
whenever I run it says break is not valid please I need help
@NPStation
@NPStation 3 жыл бұрын
Please send a screenshot of your code so I can help
@NPStation
@NPStation 3 жыл бұрын
Npstation2018@gmail.com
@isanegaming4712
@isanegaming4712 2 жыл бұрын
Error is coming true is not defined
Little Hackers : Learning to Code for Early Readers
3:39
NPStation
Рет қаралды 693
How To Make A Clock using Python | Python Project Ideas
10:51
NPStation
Рет қаралды 10 М.
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 29 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 52 МЛН
ROCK PAPER SCISSORS game in Python 🗿
9:29
Bro Code
Рет қаралды 142 М.
Refactoring a Rock Paper Scissors Lizard Spock Game // Part 2
25:15
I Made a Game in Scratch Jr and Lost my Mind
12:10
Jackson Academy
Рет қаралды 1,8 МЛН
How To Create Hangman Game in Python | Python Project Ideas
19:57
Rock Paper Scissor using Computer Vision | OpenCV Python
53:50
Murtaza's Workshop - Robotics and AI
Рет қаралды 53 М.
Programming Rock, Paper, Scissors in Python (Basics of Python)
16:57
Avery Smith | Data Analyst
Рет қаралды 2,2 М.
Create Rock Paper Scissors in Java in 10 Minutes
10:24
Coding with John
Рет қаралды 122 М.
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 29 МЛН