
W2-L2-Variables-in-Python
Presentation
•
Computers
•
6th Grade
•
Practice Problem
•
Medium
Hatoof ATS
Used 7+ times
FREE Resource
10 Slides • 3 Questions
1
Variables in Python
Programming
Today we'll explore variables in Python, which are like containers that hold
data. We'll learn how to name, assign values, and perform calculations
using variables.
by Hatoof Ababneh
2
Multiple Choice
I have a variable called "age" which holds the value "10". Can you guess what kind of variable it is?
String
Integer
Float
Boolean
3
Introduction to
Variables
A variable is a container that stores information. Think of it like a box with
a label. The label is the variable's name, and the box holds the data.
4
Variable Naming
Conventions
Start with a
letter or
underscore
For example: my_variable,
name
Use only letters,
numbers, and
underscores
For example: my_variable_1
Don't use reserved words
For example: if, else, while
5
Assigning Values to
Variables
We use the equal sign (=) to assign a value to a variable. The variable is on
the left, and the value is on the right.
name = "Alice"
age = 12
6
Arithmetic
Operations with
Variables
We can use variables in arithmetic operations.
length = 5
width = 3
area = length * width
print(area) # Output: 15
7
Variable Types:
Integers, Floats,
Strings
Integer
Whole numbers: 1, 2, 3, -5
Float
Decimal numbers: 3.14, 2.5,
-1.2
String
Text: "Hello", "World", "Python"
8
Exercise: Manipulating Variables
Let's practice using variables. Create a program to store your name and age. Then, calculate how old you will be in 5 years.
go to https://www.online-python.com/ and write your answer.
9
10
Fill in the Blanks
Type answer...
11
Variables in Real-World Applications
Games
Variables store player scores, levels, and
health points.
E-commerce
Variables track prices, quantities, and
customer information.
Scientific Research
Variables store experimental data,
measurements, and calculations.
12
Equation: Area of a Rectangle (length
* width)
1
Step 1
Identify the length and width of the rectangle.
2
Step 2
Multiply the length by the width.
3
Step 3
The result is the area of the rectangle.
13
Multiple Choice
Which Python code snippet correctly calculates the area of a rectangle?
length = 5 width = 3 area = length + width print(area)
length = 5 width = 3 area = length * width print(area)
length = 5 width = 3 area = length - width print(area)
length = 5 width = 3 area = length / width print(area)
Variables in Python
Programming
Today we'll explore variables in Python, which are like containers that hold
data. We'll learn how to name, assign values, and perform calculations
using variables.
by Hatoof Ababneh
Show answer
Auto Play
Slide 1 / 13
SLIDE
Similar Resources on Wayground
9 questions
RI 6.3: ANALYZING KEY IDEAS
Presentation
•
6th Grade
11 questions
11.1
Presentation
•
6th Grade
11 questions
Ratios and Rates
Presentation
•
6th Grade
10 questions
Finding Volume of Recatangular Prisms with Fractional Sides
Presentation
•
6th Grade
10 questions
Setting: Middle East 22-23
Presentation
•
6th Grade
10 questions
Percent Change
Presentation
•
7th Grade
8 questions
M1 Введение в программирование
Presentation
•
6th Grade
10 questions
Solving Percent Problems
Presentation
•
6th Grade
Popular Resources on Wayground
5 questions
A Home on the Shore
Quiz
•
3rd Grade
28 questions
US History Regents Review
Quiz
•
11th Grade
6 questions
A Horse Tale
Quiz
•
3rd Grade
20 questions
Math Review
Quiz
•
3rd Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
20 questions
Dividing Fractions
Quiz
•
5th Grade
55 questions
A Long Walk to Water Final Review
Quiz
•
6th - 8th Grade
10 questions
Equation Word Problems
Quiz
•
7th Grade
Discover more resources for Computers
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
55 questions
A Long Walk to Water Final Review
Quiz
•
6th - 8th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
10 questions
Static and Dynamic Characters
Quiz
•
6th Grade
42 questions
ELA Final Exam Review
Quiz
•
6th Grade
23 questions
Potential and Kinetic Energy
Quiz
•
6th Grade
20 questions
All About Chicken Nuggets
Quiz
•
6th Grade
28 questions
A Rover's Story, part 1
Quiz
•
6th - 8th Grade