Python User Input & Control Flow | Python tutorial

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

Dave Gray

Dave Gray

Күн бұрын

Пікірлер: 74
@itsaak
@itsaak 10 ай бұрын
Thank you so much, you are single handedly teaching me python in a very user friendly and simple way.
@burgeronus5963
@burgeronus5963 Жыл бұрын
Love the length of these videos; i feel like many python tutorials are hours long which can be kind of daunting! keeping each video on a few topics makes it much easier to take on. thanks!
@user-hannaingrín
@user-hannaingrín 11 ай бұрын
These vidoes are awesome, thanks for making them Dave!
@juanmayen21
@juanmayen21 Жыл бұрын
Thanks a ton for making these videos Dave.
@bensonibeabuchi
@bensonibeabuchi Жыл бұрын
Hi Dave, thank you for these videos, I have watched your tutorials on HTML, CSS, Javascript, React (not-finished) and Next.js. You are the best. For improving the game code, can I re-write the code as: * if player == 1: player = "Rock" elif player == 2: player = "Paper" else: player = "Scissors" * instead of importing Enum? obviously you will do it for computer and then print("You chose " + player + ".") print("Python chose " + computer + ".")
@Microwaveoficial
@Microwaveoficial 8 ай бұрын
For those who are running into problems: Just replace the "|" with "or"
@sundarinsyifa9633
@sundarinsyifa9633 6 ай бұрын
Thankyouu
@Microwaveoficial
@Microwaveoficial 6 ай бұрын
@@sundarinsyifa9633 welcome 😁
@Microwaveoficial
@Microwaveoficial 6 ай бұрын
@@sundarinsyifa9633 welcome
@LFT-f4n
@LFT-f4n 3 ай бұрын
tysm i was so confused
@Microwaveoficial
@Microwaveoficial 3 ай бұрын
@@LFT-f4n you're welcome!
@ClashOfMedias
@ClashOfMedias Жыл бұрын
Now my class start learning Python, these lessons help me a lot.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Glad to hear it!
@ashishranjan2864
@ashishranjan2864 8 ай бұрын
THANK YOU FOR MAKING MY LEARNING SO EASY WITH YOUR GREAT EXPLANATIONS DAVE 👍👍
@LeonelLopezBorbon
@LeonelLopezBorbon Жыл бұрын
AMAZING DAVE!!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you!
@adamcylee
@adamcylee Ай бұрын
You are very good. You are EXCELLENT! Love from SINGAPORE
@cookie12932
@cookie12932 2 ай бұрын
I got a problem. The mini-game works when I run it through the play button and type 1,2 or 3. It wont work when I type 1,2 or 3 in the terminal. It will just return whatever number i typed. If I type 2, it will just return the number 2 etc.
@anthonyythomas
@anthonyythomas Жыл бұрын
Excellent video! I did have trouble triggering the 'exit' if statement for invalid player entries though. It seems the pipe no longer works as an 'or' operator in Python 3.12.0. I got the statement to trigger by simply using 'or' instead of the pipe.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
A correction should have shown as a pop-up on the screen? Noted in the description. You are correct, btw! 💯
@Blonar257
@Blonar257 6 ай бұрын
Awesome tutorial! Thank you so much. 1 question: is RPS(player).name not much simplier that replace, or am i missing something?
@ayushkathariya
@ayushkathariya Жыл бұрын
print('Thanks Dave! ')
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Welcome!
@aleemazeez263
@aleemazeez263 6 ай бұрын
Print ('Real!')
@BBH_army123
@BBH_army123 3 ай бұрын
print(‘a bit late’) print(‘thanks’)
@alexanderkomanov4151
@alexanderkomanov4151 Жыл бұрын
As perfect as usual!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you!
@appendix-q6k
@appendix-q6k 11 ай бұрын
When I enter 2 for my choice and press enter it only just takes me back to another prompt but it doesn’t tell me what I selected vs what the computer selected. What is the issue? 10:48
@Lena-pz4cw
@Lena-pz4cw 11 ай бұрын
I had the same, and for me was an indentation issue in your code. The lines following the if player < 1 or player > 3: condition should be properly indented to be inside the if block
@nishantsingh4923
@nishantsingh4923 3 ай бұрын
Hey Dave, thanks for making these videos. I want to know if u want to continue the RPS game (that the program should not end and again ask for input value) what command can be used for this.
@DaveGrayTeachesCode
@DaveGrayTeachesCode 3 ай бұрын
Keep going in this series. We will do that and more!
@7doors847
@7doors847 Жыл бұрын
Great series Dave 🔥 Definitely good to take a JS every now and then. Let’s see how far you take us!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you!
@7doors847
@7doors847 Жыл бұрын
I meant ‘take a break’ 😅 Thank you Dave! Keep the good stuff flowing 🤘
@javedsultan4830
@javedsultan4830 Жыл бұрын
@@DaveGrayTeachesCode Hi Dave your tutorial are the best and simple to follow..thanks
@johnaweiss
@johnaweiss Жыл бұрын
12:19 i like python a lot. But i don't like the keyword `elif`. Why did they call it that? It's inconsistent. If you're going to say elif for elseif, then you should say el for else.
@anirudh2660
@anirudh2660 Жыл бұрын
Nice video. Please upload video regularly plzzz dev. And thanks for your amazing content as always.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you! I upload every Tues & Friday. Lately, Python on Tuesdays.
@ColombianCatastrophe
@ColombianCatastrophe 5 ай бұрын
When I enter any 3 numbers in the terminal(1 for rock, 2 for scissors, 3 for paper) nothing happens. I am not sure what the issue is. Can anyone help?
@lionex24
@lionex24 3 ай бұрын
did you ever figure out wat went wrong cus im on the same problem .
@amrithapv5217
@amrithapv5217 10 күн бұрын
Me too have same issue
@Trader0101-jl6qg
@Trader0101-jl6qg 10 күн бұрын
​@@amrithapv5217 try make sure all the 4 (print) lines has no space behind it
@klenderXD
@klenderXD 9 ай бұрын
So I am trying to add that only int can be used. So if I would type a letter or another character besides a number it would print to try again with a number. I have been trying for a while now but can't figure it out to add it in this code. I could use some help.
@muzhaffarhaydar7928
@muzhaffarhaydar7928 6 ай бұрын
thanks dave
@japethspeaketh7034
@japethspeaketh7034 4 ай бұрын
The sys.exit command isn't working. I entered a value other than 1, 2 and 3 and the programme still executed. It didn't exit the programme.
@AliHasan-t3g
@AliHasan-t3g 2 ай бұрын
the shtf+alt+arrowdown shortcut doesnt work on my laptop, any alternatives or a way to fix this??
@DaveGrayTeachesCode
@DaveGrayTeachesCode 2 ай бұрын
Go the Selection menu in VS Code and choose "Copy Line Down". If the keyboard shortcut is different on your computer, it should list it to the right of the selection.
@PierreBrassau
@PierreBrassau Ай бұрын
I am facing a problem with the "import random" module can anyone please help me here, the problem is " Lib andom.py" is overriding the stdlib module "random" " it is saying this when I am running this code along side Dave. my python version is 3.13
@VictorChukwuemeka-o3x
@VictorChukwuemeka-o3x 10 ай бұрын
Nice video Dave but I am have trouble anytime I type computer it keeps showing that computer isn't defined
@VictorChukwuemeka-o3x
@VictorChukwuemeka-o3x 10 ай бұрын
So I changed it to compter rather computer
@antwierasmus
@antwierasmus Жыл бұрын
Hey Dave, thanks you for the contents and education, I have been learning a lot from all your videos. Please can you also teach us something about using react animation packages like react spring? I have been trying to read the docs and wrap my head around it, but everything seems complicated.
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
You're welcome and thanks for the request!
@VictorChukwuemeka-o3x
@VictorChukwuemeka-o3x 10 ай бұрын
Progress over perfection
@mortezafarhangpanah256
@mortezafarhangpanah256 Жыл бұрын
Thanks
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Welcome!
@aswanivmanoj8115
@aswanivmanoj8115 Жыл бұрын
Thank u
@michaelscofield5343
@michaelscofield5343 Жыл бұрын
you're the best 😍
@inteliconn995
@inteliconn995 Жыл бұрын
Thanks!
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Welcome!
@abzmantawil
@abzmantawil Жыл бұрын
waiting for the best mentor DAVE GRAY to create a full stack project with react typescript as front end and python as backend and mongo db as database 🤲 🙏🙏🙏🙏
@DaveGrayTeachesCode
@DaveGrayTeachesCode Жыл бұрын
Thank you for the request! That won't be part of this beginners series, but it could happen sometime afterwards. 🚀
@PorterMesservey
@PorterMesservey 5 ай бұрын
ANYONE WATCHING THIS IN THE FUTURE, IF YOUR IF STATEMENT ISNT WORKING AS EXPECTED, REPLACE THE "|" CHARACTER WITH THE WORD "or"
@johnaweiss
@johnaweiss Жыл бұрын
Personally, i would prefer arbitrary human-friendly labels, with embedded spaces if needed. I wouldn't display an enum or constant name to the user.
@azizbeksadullayev-pk6ud
@azizbeksadullayev-pk6ud Жыл бұрын
Alloh rozi bolsin
@azizbeksadullayev-pk6ud
@azizbeksadullayev-pk6ud Жыл бұрын
Hello brother, are you a Muslim?
@michaelscofield5343
@michaelscofield5343 Жыл бұрын
it's better to avoid such things
Python Lists & Tuples for Beginners | Python tutorial
32:01
Dave Gray
Рет қаралды 20 М.
PLEASE Use These 5 Python Decorators
20:12
Tech With Tim
Рет қаралды 129 М.
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,7 МЛН
How I Would Learn Python FAST (if I could start over)
12:19
Why You Need Custom Exception Classes
6:05
ArjanCodes
Рет қаралды 21 М.
Python File Handling for Beginners
22:40
Dave Gray
Рет қаралды 28 М.
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 345 М.
Python While Loops & For Loops | Python tutorial for Beginners
23:11
Learn Python OOP in under 20 Minutes
18:32
Indently
Рет қаралды 183 М.
10 Important Python Concepts In 20 Minutes
18:49
Indently
Рет қаралды 486 М.
Python Dictionaries and Sets for Beginners | Python tutorial
29:54
5 Python Libraries You Should Know in 2025!
22:30
Keith Galli
Рет қаралды 90 М.
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН