A ten-minute Python crash course covering variables, data types, math, logic, loops, functions and exceptions.
Python is case-sensitive and uses underscore namingitem with a small i and item with a big i mean absolutely different things, and multi-word names get an underscore, as in item_name.
Convert types before combining themText and integers cannot be joined directly, so wrap the integer in str() or the string number in int() before adding.
Functions exist to reuse codeOne say_hello function called with Mario and then Luigi replaces writing the same print statement twice.
Executive SummaryAI
The speaker opens a beginner tutorial promising to get viewers started with Python in under 10 minutes, using Python 3.8 and the PyCharm editor, both free, open source and findable on Google.
He starts with variables: pick a name such as item, assign it a value, remember Python is case-sensitive so item with a small i and item with a big i are different, and join words with an underscore as in item_name.
He then walks the core data types — integers, strings in quotation marks, booleans that are just true or false, and lists holding a mixture of values — printing 2021, text, false and the list to show them.
Because a string and an integer cannot be combined directly, he shows str() around an integer and int() around a string number before adding 10, then runs through the math operators: plus, minus, asterisk, slash and double asterisk for exponents, so 10 plus 5 gives 15.
The second half covers if/elif/else on age 28 versus 21 and 18 and on is_happy, for loops over range(3) where the index starts at zero, while loops incrementing i until it reaches five, infinite while True loops exited with break on input 0, functions defined with def and reused for Mario and Luigi, the pass keyword for empty blueprints, and a try/except block that catches adding Mario to 10.
Key Quote
“What is up guys, in this video I'm going to be showing you how you can get started with Python in less than 10 minutes.”
— Speaker
Key Quote
“They are free and open source, so definitely do check those out.”
— Speaker
Key Quote
“Then we have booleans, which is just a simple true or false.”