Introduction to Python Variables and Data Types
Introduction to Python Variables and Data Types
What is Python?
• Python is a popular programming language.
• It is used to create websites, games, apps, and more.
• Python is simple and easy to understand.
What is a Variable?
• A variable is like a container that stores information.
• You can give it a name and put a value in it.
• You can change the value of a variable later.
Example:
age = 12
name = "Asha"
Rules for Naming Variables
• Use letters, numbers, and underscores.
• Cannot start with a number.
• No spaces allowed.
• Example: student_name, score1
Practice Questions
Multiple Choice Questions (MCQ)
1. Which of these is a programming language?
o a) English
o b) Python
o c) Book
o d) Paint
Answer: b) Python
2. What is the correct way to create a variable in Python?
o a) 12 = age
o b) age = 12
o c) age == 12
o d) variable age 12
Answer: b) age = 12
3. What kind of value is stored by the variable name = "Arun"?
o a) Integer
o b) Float
o c) String
o d) Boolean
Answer: c) String
4. Which data type stores values like True or False?
o a) Integer
o b) String
o c) Boolean
o d) Float
Answer: c) Boolean