Python How To Program Pt 7

[ad_1]
I answer the Python questions you sent including Error Handling, unconventional uses for functions, Examples using lists, how to use elif, Conditional Expressions and more.

Code is here:


Posted

in

by

Tags:

Comments

37 responses to “Python How To Program Pt 7”

  1. Terry Morris Avatar

    After watching your tutorial on assembly and not understanding most of what you said I found your series on Python. I haven't cracked either book I picked up to learn Python. Your tutorials are fully understandable through part 7. Its late and need to retire for the night. Thanks.

  2. Yuchang Chen Avatar

    I think you should put the try block in the main method. Like:
    firstVal = input("Enter the first numbr: ")
    secondVal = input("Enter the second numbr: ")
    try:
    divideNStuff(int(firstVal), int(secondVal))
    except ValueError:
    print("Inputs must be numbers")

  3. Yuchang Chen Avatar

    Thanks for this great video. The last example seems there is still error if we don't enter the first input or second input. The error is when you tried to put a non-numeric var in int(), then ValueError comes.

  4. Persist.Resist Avatar

    very easy tutorials,thankyou for your effort .Please make videos on Matlab OO programming .

  5. Terry Wright Avatar

    MORE! WE WANT MORE TUTORIALS! I want to learn everything I can about Python and your tutorials are so perfect for me! You explain everything so well. Please continue making these tutorials. I want to learn advanced Python. My end goal is to design a program with a nice GUI for my headunit that can control 4 stepper motors and set them to individual positions (this is to adjust my suspension dampening). I also want to make a better car diagnostic tool that I can access through my touch screen headunit that taps into the car's computer via wifi dongle with my raspberry pi 2.

  6. GobblowGalaxyGamer Avatar

    How come @6:55 you were able to put your whole if/else statement on one line?

  7. Puppet Master Avatar

    Dude your tutorials are godlike! I  tried to experiment with the codes and commands and learned everything you showed in your vids in one day!
    R8 10 / 10

  8. Birdstar Avatar

    I really would like to learn basic game development, I heard Python was an easier one to do that with. :/

  9. Manoel Neto Avatar

    Hello Derek! I`m from Brazil, but I would love to travel to you to have some lessons! Would you teach me for like a week? We could do a little projetc! I would pay you! We could record our sessions! Pleeease! 

  10. Matt Dathew Avatar

    i watched all the series, thank-u Derek. i probably shud've watched 2.7, am gonna catch up on it

  11. Derek Banas Avatar

    Thank you 🙂 I wish you the best as well.

  12. Tamanna Qureshi Avatar

    I wish you both best for your future together.

  13. Derek Banas Avatar

    No I've been married for 11 years. I'm an old man 🙂

  14. Tamanna Qureshi Avatar

    so… are you single

  15. Derek Banas Avatar

    Thank you 🙂 I can definitely say I don't hear that ever.

  16. Tamanna Qureshi Avatar

    Okay I need to say you are completely awesome and I HAVE A CRUSH ON YOU!!

  17. Derek Banas Avatar

    Thank you and you're very welcome 🙂

  18. ThinkPositive00 Avatar

    Amazing exception handling demonstration! Helps for more languages than just python too. Thank you

  19. Hanganu Petru-Alin Avatar

    Bat I want to know more about python 3.* not 2.* :

  20. Derek Banas Avatar

    No there are tutorials on using python with regular expressions and how to create automated sites using python as a final project. I then cover more in the python 2.7 tutorial series

  21. OriginalJoseyWales Avatar

    is this the last tutorial ?

  22. Derek Banas Avatar

    You're very welcome 🙂 I'm glad you enjoyed them

  23. Run Abra Avatar

    Thanks your the best!!!!!!!!!!!
    Make more vids lol if you can Thank you

  24. lisszn Avatar

    thanks! I'm going

  25. Derek Banas Avatar

    The next part of this tutorial goes into regular expressions with python. Then I go into Python 2.7 which I cover more completely

  26. lisszn Avatar

    NO PT8 and later?

  27. Livewya-Programmer Avatar

    i don't understand need to be clearer all vedios

  28. Derek Banas Avatar

    Sorry I couldn't get to you quicker, but I'm glad you figured it out 🙂

  29. Cyd Ferree Avatar

    um…never mind. I see now that I need to try and catch the error when it is being cast to an integer, which happens before "divideNStuff" actually gets called. Doh!

  30. Cyd Ferree Avatar

    Ok, it totally ignored my white space. But I know it was correct, because I can substitute only the name of the exception (like the zero div) and it works, so there's no syntax or indent error, just an exception that isn't caught. I am flummoxed.

    Otherwise, I am greatly enjoying the tutorial series.

  31. Cyd Ferree Avatar

    If I try the ZeroDivisionError it gets caught, but if I use ValueError, or TypeError, and then don't enter one of the values, it doesn't get caught. (I just get a traceback with a ValueError.)

    def divideNStuff(x, y):
    try:
    divResult = x/y
    except ValueError:
    print('Entry missing.')
    else:
    print(str(x) + ' divided by ' + str(y) + ' equals ' + str(divResult))

    Any ideas?

  32. Derek Banas Avatar

    @AustinOrmondeVEVO I made one in PHP Web Design and Programming Pt 21. If you understand the core concepts you can translate this into python

  33. Derek Banas Avatar

    @designernasser Thank you. I continue teaching Python in my Regex Tutorial, where I show you how to automate websites. Hope you like that too.

  34. designernasser Avatar

    awesome! keep them coming 😀

  35. Derek Banas Avatar

    @gent2910 More Python video's are coming. I'll cover the often confusing Regular Expressions later today

  36. gent2910 Avatar

    Thanks for shout out D. NTankman. You are the Messiah of Python. I love the exceptions part man, righteous, truly.. Like grease to slick up the wheels, keep the program rolling. Thats what I'm talkin bout. I like it!! I love the unconventional stuff, straight outside the box. Ya.

Leave a Reply

Your email address will not be published. Required fields are marked *