
Python Lecture 3| User input and Type conversion#python #programming
Habiba's corner · 30 lượt xem · 10 thg 11, 2026
Mô tả
In this lecture, you will learn how to make your Python programs interactive using the `input()` function. We cover how Python takes input from the user, why every input is stored as a string, and how to convert it into numbers using type conversion. Every concept is also demonstrated live in VS Code, so you can follow along step by step.
By the end of this video, you will be able to:
✔ Read user input with `input()`
✔ Understand why input is always a string
✔ Convert data types with `int()`, `float()` and `str()`
✔ Build a simple program that adds two numbers entered by the user
⏱ *Timestamps*
00:00 – Introduction: User Input in Python
00:20 – What is User Input?
01:36 – The input() Function
02:35 – Live Demo: Taking Name Input in VS Code
03:57 – Input is Always a String
05:32 – Demo: Checking Data Type with type()
07:20 – Demo: Converting Input with int()
07:52 – Type Conversion: int(), float(), str()
08:51 – Example: Add Two Numbers
09:15 – Live Demo: Sum of Two Numbers
11:04 – Practice Questions (Greeting Program and Rectangle Area)
📚 *Practice Questions*
1. Write a program that asks for the user's name and age, then prints: Hello [name], you are [age] years old.
2. Ask for the length and width of a rectangle, then calculate and print its area. Hint: use `int()` or `float()`.
#programming #programmingforbeginners #Python
Python for beginners
Python input function