

Python Data Types and Variables
Presentation
•
Computers
•
8th - 12th Grade
•
Easy
Michael Kendall
Used 299+ times
FREE Resource
12 Slides • 5 Questions
1
Python Data Types and Variables

2
Today's Agenda:
- Do-Now
- Introduction to Lesson
- Lesson Objectives
- Python Data Types
- What is Syntax?
- Code Practice
- Exit Ticket: Project Stem Lesson 1.1 and 1.2
3
Introduction
You may have heard the word variable in a math class before. In this lesson, we will learn how Python handles different types of data and variables, and how it stores that data.
4
Lesson Objectives
Upon successful completion of this lesson, you will be able to:
Define and utilize variables.
Distinguish between the variable types of integer and string.
5
Python Data Types:
Integers or int ( any whole number 1, 2 ,77, 200)
Floats (any decimal point number 1.5, 3.124, 8.999)
Strings ( "Lets the user type in letters, numbers and words")
Functions (A function is a block of code which only runs when it is called. You can pass data, known as parameters, into a function.)
List
6
What is Syntax?
- the set of rules that defines the combinations of symbols that are considered to be correctly structured statements or expressions in that language.
7
Example of Python Syntax:
print(" Welcome to Computer Science! ")
Step 1: Type the keyword print
Step 2: ( ) Add parenthesis
Step 3: (" ") Add quotation marks inside the parenthesis
Step 4: (" Welcome to Computer Science ") Type Welcome to Computer Science in between the parenthesis.
8
Strings (str)
Lets the user type in letters, numbers and words
Not used for calculations
When doing calculations: be sure to check that your value is a number, not a string
Always surrounded in quotation marks
9
Multiple Select
Select all strings:
greeting = (Hello)
greeting = ("Please enter your name")
greeting = (Welcome to Comp Sci)
greeting = ("Happy Friday!!!")
10
Multiple Select
Please select all floating point numbers:
1.444
34567
777.980
32.0
21
11
What are Variables?
A name for a spot in the computer’s memory
This value can change while the program runs
Different types of data take up different amounts of space in memory
12
Creating a variable with Python:
Syntax:
variable_name = ( value)
variable_name = (" string_value")
13
Open Ended
Try it yourself:
first_name = (" Your name ")
age = (" 32 ")
print(" Hey " + first_name + " your age is " + age)
14
Creating an input statement:
Anytime we need information from the user we will use an input statement
Try it:
first_name = input (" Enter your first name")
print(first_name)
15
Open Ended
Adding an input statement:
first_name = input (" Enter your first name ")
age = input(" How old are you? ")
print(" Hey " + first_name + " your age is " + age)
16
Open Ended
What about numbers?
Try it:
num1 = input("Enter a number: ")
num2 = input("Enter a number: ")
print(num1 + num2)
17
The Fix: Adding int
num1 = int(input("Enter a number: "))
num2 = int(input("Enter a number: "))
print(num1 + num2)
Python Data Types and Variables

Show answer
Auto Play
Slide 1 / 17
SLIDE
Similar Resources on Wayground
13 questions
Data Abstraction
Presentation
•
9th - 12th Grade
12 questions
Dia de Muertos
Presentation
•
7th - 12th Grade
10 questions
Python Data Types
Presentation
•
9th - 12th Grade
10 questions
Computer Data Processing
Presentation
•
9th - 12th Grade
14 questions
CMU CS Academy 1.3.2 Exercises
Presentation
•
9th - 12th Grade
15 questions
Phishing Attacks
Presentation
•
9th - 12th Grade
10 questions
Computer Network
Presentation
•
9th - 12th Grade
15 questions
Flowchart and Pseudocode Exercise
Presentation
•
8th - 11th Grade
Popular Resources on Wayground
10 questions
GPA Lesson
Presentation
•
9th - 12th Grade
7 questions
Albert Einstein
Quiz
•
3rd Grade
31 questions
Bridge A Review
Quiz
•
3rd Grade
6 questions
Blue Sue and Red Ruth
Quiz
•
3rd Grade
8 questions
(Day12 HW) Inverse Trig Ratios
Quiz
•
9th Grade
20 questions
Summer Geometry QUIZ (Week3)
Quiz
•
9th Grade
16 questions
Theme Practice
Quiz
•
7th Grade
20 questions
Taxes
Quiz
•
9th - 12th Grade
Discover more resources for Computers
10 questions
GPA Lesson
Presentation
•
9th - 12th Grade
8 questions
(Day12 HW) Inverse Trig Ratios
Quiz
•
9th Grade
20 questions
Summer Geometry QUIZ (Week3)
Quiz
•
9th Grade
20 questions
Taxes
Quiz
•
9th - 12th Grade
16 questions
Warm Up: Basics of Geometry
Quiz
•
9th Grade
16 questions
Translations and Reflections
Quiz
•
9th - 10th Grade
17 questions
High School Survival Guide
Presentation
•
9th - 12th Grade
20 questions
Banking
Quiz
•
9th - 12th Grade