Rock Paper Scissors Game: Python Beginner Project

  Рет қаралды 5,883

NeuralNine

NeuralNine

Күн бұрын

Пікірлер: 13
@nessunolinux
@nessunolinux 8 ай бұрын
You can cut your code in half by using a dictionary to determine which choices beat which. It would look like this: # This dictionary maps each choice to the choice it can defeat win_map = { 'R': 'S', # Rock beats Scissors 'P': 'R', # Paper beats Rock 'S': 'P' # Scissors beats Paper } Then your if statements can be cut down to this: if player_choice == cpu_choice: return "It's a tie!" elif win_map[player_choice] == cpu_choice: return f'CPU wins! {player_choice} is beaten by {cpu_choice}.' else: return f'You win! {cpu_choice} is beaten by {player_choice}.' No need for all that nesting.
@AyushRai-w5c
@AyushRai-w5c 4 ай бұрын
he did do that
@DerHitsch
@DerHitsch 11 ай бұрын
Thanks for the video. It would also be interesting for another part if you could show how to implement different strategies for the computer opponent. And perhaps let the different algotithms compete against each other The simplicity of the game would make it perfect for this.
@mr.RAND5584
@mr.RAND5584 2 күн бұрын
Opencv, ocr rock paper ✂️?
@gamer310taka9
@gamer310taka9 3 ай бұрын
how do i go next in the game i pressed R but i dosent ddo anything
@DrAppalling
@DrAppalling 11 ай бұрын
I used to assign this very project in my second year ECE Tools and Toys class.
@Nebuchadnezzar1501
@Nebuchadnezzar1501 9 ай бұрын
My wins losses and ties do not print... Any suggestions why?
@miauwrits
@miauwrits 11 ай бұрын
Can you make a video about how to create a personal assistant in python?
@Al_Miqdad_
@Al_Miqdad_ 11 ай бұрын
thank you ❤❤❤
@pascal831
@pascal831 11 ай бұрын
Thanks buddy!
@mp_8634
@mp_8634 11 ай бұрын
A really early beguinner looks hard.
@aliqasem6733
@aliqasem6733 11 ай бұрын
good work
@philtoa334
@philtoa334 11 ай бұрын
Thx_.
Garbage Collection in Python: Speed Up Your Code
16:41
NeuralNine
Рет қаралды 18 М.
Tkinter Layout Managers - Simple Crash Course
15:43
NeuralNine
Рет қаралды 10 М.
Wednesday VS Enid: Who is The Best Mommy? #shorts
0:14
Troom Oki Toki
Рет қаралды 50 МЛН
🎈🎈🎈😲 #tiktok #shorts
0:28
Byungari 병아리언니
Рет қаралды 4,5 МЛН
shutil: The Ultimate Python File Management Toolkit
14:32
NeuralNine
Рет қаралды 13 М.
How Old Can a File Be?
12:11
Dev Detour
Рет қаралды 148 М.
5 Custom Python Decorators For Your Projects
25:40
NeuralNine
Рет қаралды 10 М.
How I Would Learn Python FAST in 2024 (if I could start over)
12:19
Thu Vu data analytics
Рет қаралды 633 М.
ROCK PAPER SCISSORS game in Python 🗿
9:29
Bro Code
Рет қаралды 142 М.
What are __slots__ in Python? Optimize Your Code!
10:07
NeuralNine
Рет қаралды 11 М.
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 337 М.
GUI Applications For All Platforms with Flet in Python
11:08
NeuralNine
Рет қаралды 42 М.
Coding A Simple Mastermind Game in Python
14:06
NeuralNine
Рет қаралды 6 М.