Week1_Lecture2
Week1_Lecture2
Week 1: Introduction to
Python and Programming
Basics
Lecture 2:
Basic Syntax and
Variables
Variables and Data Types
Variable: A container that stores information.
Variables Stores Data (number, word…etc).
In Python:
name = "Alice"
age = 25
temperature = 37.2
Common Data Types
Strings (text): "Hello, World!"
Integers (whole numbers): 25
Floats (decimals): 3.14
Booleans (True/False): True
Variables and Data Types
movie_title = "Inception"
release_year = 2010 Python
Code
rating = 8.8
Database
Movie Title Release Year Rating
Inception 2010 8.8
Integer Operations
Python code:
1 counter = 1
2 counter += 1 Increment by 1
3 counter += 4
------------------------------------------------------------