Learn Python - Full Course for Beginners [Tutorial]

Share

Summary

This comprehensive Python course teaches everything a beginner needs to know about Python programming. It covers fundamental concepts like installation, basic programs, variables, data types (strings, numbers, booleans), control flow (if statements, loops), functions, data structures (lists, tuples, dictionaries), and object-oriented programming (classes, objects, inheritance). The course also delves into practical applications such as building a calculator, a Mad Libs game, a guessing game, a translator, working with external files, and utilizing modules.

Highlights

Return Statement in Functions
1:34:16

This section focuses on the 'return' statement, which allows functions to send back values to the caller. It demonstrates creating a 'cube' function, showing how 'return' replaces 'print()' for outputting results and how code after 'return' is not executed.

Introduction to Python
0:00:00

This section introduces Python as a popular, in-demand, and easy-to-use programming language. It highlights Python's beginner-friendly nature and the course's objective to teach all necessary concepts for starting Python programming, emphasizing confidence in writing scripts and programs.

Installing Python and PyCharm
0:01:43

This part guides users through installing Python 3 (recommended over Python 2) and setting up PyCharm, an Integrated Development Environment (IDE), for writing Python code. It also covers initial PyCharm configuration, including theme selection and project creation, ensuring Python 3 is selected as the interpreter.

Creating Your First Python Program
0:06:33

This section walks through creating a new Python file in PyCharm and writing a basic 'Hello World' program using the 'print()' function. It explains how to run the program and understand the console output.

Understanding Python Program Execution
0:10:26

This part explains that Python programs are a set of instructions executed in order. It demonstrates this by drawing a triangle using multiple 'print()' statements, illustrating how the order of instructions matters.

Variables in Python
0:15:12

This section introduces variables as containers for storing data values. It demonstrates their utility by making a story dynamic, allowing easy changes to character names and ages. It also covers updating variable values and briefly introduces basic data types: strings, numbers, and booleans.

Working with Strings
0:27:06

This part explores various operations and functions applicable to strings, which are plain text data. It covers creating new lines ('\n'), escaping characters ('\"'), string concatenation, and functions like '.lower()', '.upper()', '.is_upper()', 'len()', string indexing, '.index()', and '.replace()'.

Working with Numbers
0:38:23

This section focuses on handling numerical data in Python. It demonstrates printing numbers, basic arithmetic operations (addition, subtraction, multiplication, division, modulus), order of operations using parentheses, storing numbers in variables, and converting numbers to strings for printing. It also introduces mathematical functions like 'abs()', 'pow()', 'max()', 'min()', 'round()', and explains how to import and use functions from the 'math' module (floor, ceil, sqrt).

Getting User Input
0:48:25

This part teaches how to receive input from users using the 'input()' function. It demonstrates storing user input in variables and using that information to make programs more interactive, such as greeting the user by name and age.

Building a Basic Calculator
0:52:39

This section guides through building a simple calculator that takes two numbers from the user, adds them, and prints the result. It highlights the importance of converting input from strings to numerical types ('int()' or 'float()') to perform mathematical operations correctly.

Building a Mad Libs Game
0:58:31

This part demonstrates how to create a Mad Libs game. Users provide words (color, plural noun, celebrity), which are then inserted into a pre-written story template, showcasing the use of variables and string concatenation.

Working with Lists
1:03:13

This section introduces lists as structures for storing collections of data. It covers creating lists, their mutability, accessing elements by index (including negative indexing), slicing lists to get sub-sections, and modifying individual elements within a list.

List Functions
1:10:47

This part delves into various functions available for manipulating lists. It demonstrates 'extend()' to add elements from another list, 'append()' to add a single element to the end, 'insert()' to add an element at a specific index, 'remove()' to delete a specific element, 'clear()' to empty the list, 'pop()' to remove the last element, 'index()' to find an element's position, 'count()' to count occurrences of an element, 'sort()' to arrange elements, 'reverse()' to invert the order, and 'copy()' to create a duplicate list.

Tuples in Python
1:18:55

This section introduces tuples as immutable data structures, similar to lists but unchangeable after creation. It shows how to create tuples using parentheses, access elements by index, and explains the key difference between tuples and lists (immutability vs. mutability). Tuples are best for data that should not change, like coordinates.

Functions in Python
1:24:10

This part explains what functions are: reusable blocks of code performing specific tasks. It covers defining a function using 'def', naming conventions, indentation for function body, calling a function, and passing parameters to make functions flexible (e.g., passing a name and age to a 'say_hi' function).

If Statements in Python
1:40:09

This part introduces if statements for making decisions in programs based on conditions. It explains the 'if', 'else', and 'elif' (else if) keywords, using boolean variables and logical operators ('and', 'or', 'not') to create complex conditions and handle different scenarios.

If Statements & Comparisons
1:54:11

This section expands on if statements by incorporating comparison operators. It demonstrates how to compare numbers and strings using operators like '==', '!=', '>', '<', '>=', '<=', and shows how these comparisons evaluate to boolean values to drive conditional logic within a function to find the maximum of three numbers.

Building an Advanced Calculator
2:00:40

This part builds a more advanced calculator that handles addition, subtraction, multiplication, and division. It uses 'input()' to get two numbers and an operator from the user, converting numbers to floats, and then uses a series of 'if' and 'elif' statements to perform the correct operation based on the entered operator.

Dictionaries in Python
2:07:20

This section introduces dictionaries, a data structure for storing information in key-value pairs. It explains their concept using an analogy to a traditional dictionary. It demonstrates creating a dictionary for month abbreviations to full names ('month_conversions'), adding entries, accessing values using keys (square bracket notation or '.get()'), and handling cases where a key is not found using a default value.

While Loops in Python
2:14:18

This part covers while loops, which repeatedly execute a block of code as long as a specified condition remains true. It illustrates a basic while loop that prints numbers from 1 to 10, explaining the loop condition ('loop guard') and how an incrementing variable eventually terminates the loop.

Building a Guessing Game
2:20:05

This section builds a guessing game using while loops and if statements. The game involves a secret word the user tries to guess, with a limited number of attempts. It demonstrates tracking guesses, setting a guess limit, and providing feedback (win/lose message) based on the user's performance.

For Loops in Python
2:32:47

This part introduces for loops for iterating over collections of items. It demonstrates looping through characters in a string, elements in a list, and a range of numbers using the 'range()' function. It also shows how to use a for loop in combination with 'len()' to iterate through a list by index.

Building an Exponent Function
2:41:24

This section teaches how to create a custom exponent function using a for loop. While Python has a built-in exponent operator, this exercise demonstrates the underlying logic, taking a base number and a power number as input, and multiplying the base by itself the specified number of times using a loop.

2D Lists & Nested Loops
2:47:17

This part covers two-dimensional lists (lists of lists) for representing grid-like data structures. It shows how to create and access elements within a 2D list using multiple indices. It then demonstrates using nested for loops to iterate through all elements of a 2D list, effectively parsing through the grid.

Building a Translator
2:52:44

This section details building a simple translator. It defines a 'draft language' where all vowels become 'G'. The translator function uses a for loop to iterate through a phrase, an 'if' statement to check for vowels (both uppercase and lowercase), and builds the translated string by appending 'G' or the original consonant. It includes an improvement for maintaining original capitalization.

Comments in Python
3:00:17

This short tutorial explains the use of comments in Python code. It covers single-line comments using the '#' symbol and multi-line comments using triple quotes. It emphasizes their role for documentation, notes, and temporarily disabling code ('commenting out').

Error Handling with Try/Except
3:04:17

This part introduces error handling using 'try' and 'except' blocks. It demonstrates how to anticipate and gracefully handle errors, such as a 'ValueError' when a user enters non-numeric input or a 'ZeroDivisionError'. It shows how to catch specific error types and optionally print the error message.

Reading from Files
3:12:32

This section teaches how to read data from external files in Python. It covers opening a file in 'read' mode ('r'), storing it in a variable, checking if it's readable, and closing it ('close()'). It demonstrates 'read()' for entire content, 'readline()' for single lines, and 'readlines()' for all lines into a list, and iterating lines with a for loop.

Writing to Files
3:22:15

This part focuses on writing data to files. It covers opening files in 'append' mode ('a') to add content to the end and 'write' mode ('w') to overwrite existing content or create new files. It emphasizes careful use of 'w' mode due to data loss risk and demonstrates adding newlines ('\n').

Modules in Python
3:28:17

This section explains Python modules as external `.py` files containing reusable code (functions, variables). It demonstrates importing a custom 'useful_tools.py' module and accessing its functionalities. It also guides on finding and installing third-party modules using 'pip' from the command line, highlighting the Python Standard Library documentation and the 'site-packages' folder.

Classes and Objects
3:43:58

This tutorial introduces Object-Oriented Programming (OOP) concepts: classes and objects. It explains how classes define custom data types to model real-world entities (e.g., a 'Student' class with attributes like name, GPA, major). Objects are instances of these classes, representing actual entities with specific values. It covers defining constructors (`__init__`) to initialize object attributes.

Building a Multiple Choice Quiz
3:57:40

This section demonstrates building a multiple-choice quiz using classes and functions. It creates a 'Question' class to store question prompts and answers. An array of 'Question' objects is then used in a 'run_test' function, which iterates through the questions, takes user input, checks answers, and calculates a final score.

Class Functions
4:08:28

This part introduces methods (functions defined within a class) that operate on objects of that class. It demonstrates adding a 'on_honor_roll' method to the 'Student' class, which checks if a student's GPA meets a certain criterion. This shows how class functions can provide information specific to individual objects.

Inheritance
4:19:35

This section explains inheritance, an OOP principle where one class (child/subclass) can inherit attributes and methods from another class (parent/superclass). It uses a 'Chef' class and a 'ChineseChef' subclass to illustrate how a child class can reuse parent class functionality and also override methods or add new ones, reducing code duplication.

Python Interpreter
4:20:50

This tutorial introduces the Python interpreter, an interactive environment for executing Python commands line by line. It explains how to access it via the command prompt/terminal and demonstrates simple commands, variable assignments, and function definitions. It highlights the interpreter's use for quick testing and debugging, contrasting it with writing full programs in a text editor.

Recently Summarized Articles

Loading...