Learn Python in Only 30 Minutes (Beginner Tutorial) Complete Notes

Video byIndently
  • 30:03 video
  • 14 chapters
  • 10 flashcards
  • 6-question quiz

This beginner tutorial packs Python's foundations into 30 minutes: print, variables, all 8 data types, functions, loops, decisions, error handling and imports — ending with a working chatbot project. These notes follow the video in order with timestamps, so you can revise the whole video in minutes or jump straight to the topic you need.

✎ Before you startYou only need 2 things before starting (video @ 0:19): Python installed + a code editor installed. The teacher uses PyCharm (free, from JetBrains).

1. print() — Your Very First Script

print() tells Python to display something in the console. Text always goes inside quotation marks — single ' ' or double " " both work, pick one style and stay consistent.

print('Hello, World!')
print('Hello, Bob!')

Output → 'Hello, World!' then 'Hello, Bob!' — each print() appears on its own line.

Run the script with the green arrow in PyCharm (or set your own Run shortcut: Settings → Keymap → Run). Change the text to anything you like — the output changes with it. That is your first program, done!

2. Variables — Give Your Data a Name

A variable stores a value under a name, so you can reuse it everywhere instead of typing the value again and again.

name = 'Bob'
print('Hello, ' + name + '!')

Output → 'Hello, Bob!'

That + joining of strings is called string concatenation — 'Hello, ' + name + '!' are glued into one string.

Now change only one line — name = 'James' — and every place that uses name updates automatically:

name = 'James'
print('Hello, ' + name + '!')   # Hello, James!

★ Golden tipVariables = reusability. Define once, use everywhere. This one idea comes back in every single topic below.

3. Data Types — The 8 Kinds of Data

Until now we used text. Python has many data types — learn to recognise each one by its brackets and shape:

TypeLooks likeRemember
str (string)'Apple'Plain text, inside quotes.
int (integer)10 or -10Whole numbers — no decimal point.
float10.5 or 10.123Numbers WITH a decimal point.
bool (Boolean)True / FalseOnly 2 states. Capital T and F!
tuple(2.5, 1.5)List-like, round brackets — IMMUTABLE: cannot change after creation.
list['Agneta', 'Bea', 'Benny', 'Anifred']Square brackets — MUTABLE: add & remove items freely.
set{1, 2, 3, 4, 5}Curly brackets — NO duplicates allowed (a second 4 simply disappears).
dict (dictionary){'Bob': 1, 'James': 2}KEY : VALUE pairs — each key is linked to a value, like name → ID.

⚠ RememberMutable = can change (list). Immutable = locked forever (tuple). And in a set, duplicates vanish automatically — {1, 2, 3, 4, 4, 5} prints as {1, 2, 3, 4, 5}.

4. Type Conversion — Changing One Type Into Another

Data often arrives in the wrong type — e.g. a number scraped from the internet arrives as a string '100'. You cannot do maths with it: 10 + '100' gives an error, because an int can only be added to numbers, and a string only to strings.

Fix it with a type constructor — write the target type + parentheses around the value:

number = '100'
print(10 + int(number))      # 110  ✔ works!
print(float('123.456'))      # 123.456
print(int('ten'))            # ValueError ✘ — 'ten' is a word, not digits!

Works with any type: int(), float(), str(), set()… You can convert a variable or a value written directly. The conversion only succeeds if the value genuinely represents that type — digits can become an int, the word 'ten' cannot.

5. Type Annotations — A Label That Protects You

A type annotation is you declaring what type a variable should be, using a colon:

age: int = 10
first_name: str = 'Bob'

Python itself ignores annotations — the code runs exactly the same even if you break your own rule. So why bother? Your editor / static type checker reads them and warns you the moment you do something silly, like assigning text to a variable declared as int:

age: int = 'ten'   # ⚠ editor warns you instantly — before you run anything!

★ Golden tipAnnotations are optional but professional. The teacher uses them in every lesson — learn this habit now, it will save you hours of debugging later.

6. f-Strings — The Clean Way to Build Strings

Joining with + is painful: you must convert every number with str() by hand. An f-string (f = formatted string) lets you drop variables directly inside the text using curly brackets { }:

name: str = 'Bob'
age: int = 10

# ✘ old way — long, error-prone
print('Name: ' + name + ', Age: ' + str(age))

# ✔ f-string way — short & readable
print(f'Name: {name}, Age: {age}')

Output → 'Name: Bob, Age: 10' — identical result from both lines.

★ Golden tipUse f-strings whenever you can. You will rarely see a professional Python developer concatenating with + .

7. Functions — Write Once, Reuse Forever

A function packages code so you can reuse it anywhere, as many times as you like. Create one with the def keyword (= define):

def add(a: float, b: float) -> float:
    print(f'Adding {a} + {b}')
    return a + b

print(add(10, 15))    # Adding 10 + 15  →  25.0
print(add(15, 30))    # Adding 15 + 30  →  45.0

Anatomy: a and b are parameters (inputs) • -> float declares the return type • return sends the answer back • the values you pass in, like 10 and 15, are the arguments.

Why not just write 10 + 15 twice? Because if the behaviour must change, you edit one function and every call updates — the 'Adding…' line above was added once, and both calls printed it.

Default values — make an argument optional:

def greet(name: str, greeting: str = 'Hi') -> None:
    print(f'{greeting}, {name}!')

greet('Bob', 'Hello')   # Hello, Bob!
greet('James')          # Hi, James!  ← default 'Hi' used

-> None means the function returns nothing — it only does something (prints). A function may also have zero parameters: write def say_hello(): and simply call say_hello() whenever you want that code to run.

8. Loops — Repeat Without Copy-Pasting

Python has 2 loops: for for a finite (countable) number of repeats, and while for looping until a condition changes.

The for loop:

for i in range(3):
    print('Hello')        # Hello  Hello  Hello  (3 times!)

names: list[str] = ['Agneta', 'Bea', 'Benny', 'Anifred']
for name in names:
    print(f'Hello, {name}!')

range(3) produces 3 numbers (0, 1, 2), so the loop body runs 3 times. Looping over a list visits each item once — 4 names = 4 greetings. Everything indented under the loop runs on every round.

The while loop:

i: int = 0
while i < 3:
    print(i)
    i += 1        # i = i + 1 — move one step closer to the end!

Output → 0 1 2 — then i becomes 3, 3 < 3 is False, loop stops.

Dry run — watch i change:

Roundi at starti < 3 ?Printsi after i += 1
10True ✔01
21True ✔12
32True ✔23
—3False ✘ → STOP——

⚠ Rememberwhile True: with no way to stop runs forever — True is always true! A while loop needs a condition that will eventually become False, like the counter above reaching 3.

9. Comparison Operators — Asking Yes/No Questions

Comparisons always answer with a bool — True or False. Memorise all 6 (a = 1, b = 2):

OperatorMeaningExampleResult
>greater thana > bFalse
>=greater than OR equala >= bFalse (True if a == b)
<less thana < bTrue
<=less than OR equala <= bTrue
==equal to — DOUBLE equals!a == bFalse
!=not equal toa != bTrue

⚠ Remember= assigns a value (name = 'Bob'). == compares two values. Mixing them up is the most common beginner mistake in all of Python!

10. if / elif / else — Making Decisions

Your program checks conditions from top to bottom and runs the first block whose condition is True. elif = 'else if' (add as many as you want). else = everything else — the fallback.

user_input: str = 'hello'

if user_input == 'hello':
    print('Bot: Hello!')
elif user_input == 'how are you':
    print('Bot: Good, how about you?')
elif user_input == 'bye':
    print('Bot: Goodbye!')
else:
    print('Bot: Sorry, I did not understand that.')

Now add just 2 things — a while True: loop around it and input() to read real typing — and this becomes a working chatbot: type 'hello' → it greets you, 'bye' → goodbye, anything else → it politely says it didn't understand. (The final project in chapter 13 builds exactly this!)

11. Exceptions — When Things Go Wrong, Don't Crash

An exception is an error that stops your whole program — e.g. printing an undefined name gives a NameError, and adding a string to an int gives a TypeError:

a: int = 10
b = '15'          # ← user typed text instead of a number!
print(a + b)      # TypeError: int and str do not go together ✘ CRASH

Protect risky code with try / except — 'try this; if it fails, do that instead' — and your program keeps running:

try:
    print(a + b)
except TypeError:
    print('Please enter a number as an integer or float.')

print('Program continues...')   # ✔ we still reach here!
  • Catch the SPECIFIC error (TypeError, ValueError…) and give the user a message that tells them how to fix it.
  • Multiple except blocks are allowed — one per kind of error you expect.
  • Catching plain Exception swallows every error silently — the teacher calls this bad practice. Use it only as a last resort: errors during development are your teachers, they show you what can go wrong.

12. Imports — Borrow Ready-Made Superpowers

Don't reinvent maths! import brings a ready-made module into your script. Python's built-in math module even has a square-root function:

import math
print(math.sqrt(3))          # 1.7320508...

import math as m             # alias — a shorter nickname
print(m.sqrt(4))             # 2.0

from math import sqrt, tan   # import only what you need
print(sqrt(5))               # 2.2360679...
print(tan(2))                # -2.1850398...

3 styles, same result: import math (use math.sqrt) • import math as m (use m.sqrt) • from math import sqrt (use sqrt directly, and you can import several names at once).

13. FINAL PROJECT — Your First Chatbot (Everything Combined!)

This one project uses almost everything from these notes: variables, annotations, f-strings, loops, if/elif/else, the in operator, lists, input, .lower() and try/except.

✎ the complete chatbot — type it, run it, then extend it!
bot_name: str = 'Bob'
print(f'Hello, I am {bot_name}. How can I assist you today?')

while True:
    user_input: str = input('You: ').lower()

    if user_input in ['hi', 'hello', 'hey']:
        print(f'{bot_name}: Hi there! How can I help you?')
    elif user_input in ['bye', 'see you']:
        print(f'{bot_name}: Goodbye, have a great day!')
    elif user_input in ['+', 'add']:
        print(f'{bot_name}: Sure, let us do some addition!')
        try:
            num1: float = float(input('First number: '))
            num2: float = float(input('Second number: '))
            print(f'{bot_name}: The sum is {num1 + num2}')
        except ValueError:
            print(f'{bot_name}: Oops, that is not a valid number. Try again!')
    else:
        print(f'{bot_name}: I am sorry, I do not understand that.')

Output → You: Hi → Bob: Hi there! • You: add → 10, 20 → Bob: The sum is 30.0 • You: blah → Bob: I am sorry… • You: bye → Bob: Goodbye, have a great day!

3 clever details to notice:

  • .lower() — Python is case-sensitive: 'Hello' ≠ 'hello'. Lowercasing the user's input first makes comparisons reliable.
  • in [ ... ] — checking membership in a list understands many forms of the same intent ('hi', 'hello', 'hey') in one line, instead of one elif per word.
  • float(input(...)) + except ValueError — the annotation warned the editor that input() gives a string; converting inside try means a letter typed as a 'number' gets a friendly message instead of a crash.

14. Golden Advice — How Real Programmers Learn

  • The best way to learn is to BUILD apps. Decide what you want to make, start coding, and Google what you need as you go — even after 5 years, the teacher Googles constantly. That IS the job.
  • Start SMALL. Don't try to build Facebook on day one — it is hundreds of concepts combined, and starting too big is how beginners give up.
  • Grow this chatbot: teach it new replies, add subtraction/multiplication, let it scrape information from the internet. Small improvements, one at a time.

Notes generated from: 'Learn Python in Only 30 Minutes (Beginner Tutorial)' by Indently — youtube.com/watch?v=Ro_MScTDfU4. Watch the video alongside these notes for the full explanations. All code examples are the video's own, checked line by line.

Finished reading? Lock it in.

Flashcards

Read the question, answer in your head, then flip.

1 / 10

Tip: Space flips, arrow keys move. On a phone, swipe.

Quiz

6 questions. Pick an answer to check it.

0 correct
  1. Question 1 of 6

    Which of these data types is IMMUTABLE (cannot be changed after creation)?

    Show answer

    Answer: tuple

    A tuple (round brackets) is locked forever. Lists, sets and dicts can all be changed.

  2. Question 2 of 6

    What is the value of 10 + int('100')?

    Show answer

    Answer: 110

    int('100') converts the string to the number 100, so 10 + 100 = 110.

  3. Question 3 of 6

    What does the == operator do?

    Show answer

    Answer: Compares two values and returns True or False

    == compares. A single = assigns. Confusing them is the most common beginner mistake.

  4. Question 4 of 6

    In def greet(name, greeting='Hi'), what is 'Hi'?

    Show answer

    Answer: A default value, used when no greeting is passed

    It is a default value — greet('James') prints 'Hi, James!' because no greeting was given.

  5. Question 5 of 6

    A user types letters where a number is expected, inside a try block with float(input()). Which except catches it?

    Show answer

    Answer: ValueError

    Converting text that is not a number raises ValueError — that is why the chatbot project uses except ValueError.

  6. Question 6 of 6

    What does range(3) produce in a for loop?

    Show answer

    Answer: 0, 1, 2

    range(3) gives 0, 1, 2 — three values starting from 0, so the loop body runs 3 times.

Revision questions

Answer each one out loud, without looking back. Tick it when you can.

Download the PDF

The full notes as a print-ready file. Revise offline, print it, or keep it with your study material.

  • All 14 chapters with timestamps
  • Highlighted key ideas, code and tables
  • One-page revision questions
  • Clean A4 layout, made for printing
Download PDF

Free. One quick Google sign-in, then every PDF on NotesVid is one tap away.

Questions about these notes

Are the notes for 'Learn Python in Only 30 Minutes' free?

Yes. You can read the complete notes on this page for free, with flashcards and a quiz included. The PDF download asks for a free signup.

Who created the original video?

Indently on YouTube. These notes are an original study summary of the video — the video itself is embedded on this page and linked for full explanations.

What do these notes cover?

All 13 topics from the video in order: print(), variables, the 8 data types, type conversion, type annotations, f-strings, functions, for and while loops, comparison operators, if/elif/else, exceptions, imports, and the final chatbot project.

Can I download these Python notes as a PDF?

Yes — use the download button on this page. Reading online is always free; the PDF download needs a free NotesVid signup.

More Programming notes

Chapters
  1. 1print()0:34
  2. 2Variables1:37
  3. 3Data Types2:30
  4. 4Type Conversion4:58
  5. 5Type Annotations6:36
  6. 6f-Strings8:07
  7. 7Functions9:40
  8. 8Loops12:48
  9. 9Comparison Operators15:46
  10. 10if / elif / else17:18
  11. 11Exceptions19:30
  12. 12Imports23:30
  13. 13FINAL PROJECT24:44
  14. 14Golden Advice29:39

Get the PDF

Sign in once. Every PDF is free.

Privacy