Python User Input & Control Flow | Python tutorial

Поділитися
Вставка
  • Опубліковано 5 вер 2024

КОМЕНТАРІ • 54

  • @Microwaveoficial
    @Microwaveoficial 3 місяці тому +6

    For those who are running into problems:
    Just replace the "|" with "or"

  • @ayushkathariya
    @ayushkathariya Рік тому +9

    print('Thanks Dave! ')

  • @juanmayen21
    @juanmayen21 8 місяців тому +3

    Thanks a ton for making these videos Dave.

  • @burgeronus5963
    @burgeronus5963 7 місяців тому

    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!

  • @itsaak
    @itsaak 5 місяців тому

    Thank you so much, you are single handedly teaching me python in a very user friendly and simple way.

  • @bensonibeabuchi
    @bensonibeabuchi Рік тому +3

    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 + ".")

  • @user-hannaingrín
    @user-hannaingrín 6 місяців тому +1

    These vidoes are awesome, thanks for making them Dave!

  • @ashishranjan2864
    @ashishranjan2864 3 місяці тому

    THANK YOU FOR MAKING MY LEARNING SO EASY WITH YOUR GREAT EXPLANATIONS DAVE 👍👍

  • @dickschweiger289
    @dickschweiger289 8 місяців тому +1

    very good. Downloaded your videos so i had to go through them here to give you thumbs up and a comment. Nice

  • @horzeil184
    @horzeil184 Рік тому

    Now my class start learning Python, these lessons help me a lot.

  • @anthonyythomas
    @anthonyythomas 9 місяців тому +1

    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  9 місяців тому

      A correction should have shown as a pop-up on the screen? Noted in the description. You are correct, btw! 💯

  • @Blonar257
    @Blonar257 Місяць тому

    Awesome tutorial! Thank you so much. 1 question: is RPS(player).name not much simplier that replace, or am i missing something?

  • @LeonelLopezBorbon
    @LeonelLopezBorbon Рік тому +2

    AMAZING DAVE!!

  • @muzhaffarhaydar7928
    @muzhaffarhaydar7928 Місяць тому

    thanks dave

  • @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  Рік тому +1

      Thank you!

    • @7doors847
      @7doors847 Рік тому

      I meant ‘take a break’ 😅
      Thank you Dave! Keep the good stuff flowing 🤘

    • @javedsultan4830
      @javedsultan4830 10 місяців тому

      @@DaveGrayTeachesCode
      Hi Dave your tutorial are the best and simple to follow..thanks

  • @alexanderkomanov4151
    @alexanderkomanov4151 Рік тому +2

    As perfect as usual!

  • @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.

  • @klenderXD
    @klenderXD 4 місяці тому

    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.

  • @anirudh2660
    @anirudh2660 Рік тому

    Nice video. Please upload video regularly plzzz dev. And thanks for your amazing content as always.

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Рік тому +2

      Thank you! I upload every Tues & Friday. Lately, Python on Tuesdays.

  • @ColombianCatastrophe
    @ColombianCatastrophe 26 днів тому

    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?

  • @user-tb3dj3km2p
    @user-tb3dj3km2p 5 місяців тому

    Nice video Dave but I am have trouble anytime I type computer it keeps showing that computer isn't defined

    • @user-tb3dj3km2p
      @user-tb3dj3km2p 5 місяців тому

      So I changed it to compter rather computer

  • @user-tb3dj3km2p
    @user-tb3dj3km2p 5 місяців тому

    Progress over perfection

  • @johnaweiss
    @johnaweiss 7 місяців тому

    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.

  • @user-dz4rl8td3z
    @user-dz4rl8td3z 2 дні тому +1

    ANYONE WATCHING THIS IN THE FUTURE, IF YOUR IF STATEMENT ISNT WORKING AS EXPECTED, REPLACE THE "|" CHARACTER WITH THE WORD "or"

  • @aswanivmanoj8115
    @aswanivmanoj8115 7 місяців тому

    Thank u

  • @acausevic1
    @acausevic1 6 місяців тому

    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 6 місяців тому +1

      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

  • @mortezafarhangpanah256
    @mortezafarhangpanah256 Рік тому

    Thanks

  • @inteliconn995
    @inteliconn995 Рік тому

    Thanks!

  • @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. 🚀

  • @johnaweiss
    @johnaweiss 7 місяців тому

    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 Рік тому +1

    Alloh rozi bolsin

  • @michaelscofield5343
    @michaelscofield5343 Рік тому

    you're the best 😍

  • @azizbeksadullayev-pk6ud
    @azizbeksadullayev-pk6ud Рік тому

    Hello brother, are you a Muslim?