Python Variables, Data Types and Input/Output Explained for Beginners
Python Variables, Data Types and Input/Output
Author: Gursehbaj Singh | Blog: DevMode
What is a Variable?
A variable stores data in memory.
age = 18
name = "Gursehbaj"
Common Data Types
- int → integer numbers
- float → decimal numbers
- str → string text
- bool → True / False
- list, tuple, dict → collections
Taking User Input
name = input("Enter your name: ")
age = int(input("Enter your age: "))
print("Hello", name, "you are", age, "years old.")
Conclusion
Understanding variables, data types, and input/output is the first step in Python programming. Practice by creating simple programs like a calculator or greeting messages.
Comments
Post a Comment