Download presentation
Presentation is loading. Please wait.
1
Python Lessons 9 & 10 Mr. Husch
2
Aims Recreate a program using raw input Understand functions in Python
Create a program that combines python functions
3
Python Lesson 9
4
Changing to integer: YOU DO NOT NEED TO BUILD, IT IS JUST AN EXAMPLE!
If you don’t change the strings to an integer it will keep the quotes around the string not allowing you to combine them.
5
Lesson 9 Activity You must recreate lesson 4 activity 1 using nothing but raw inputs. You should have 7 raw inputs asking for John Doe information. After your inputs you need to print out the seven variables in a single line of code using %r instead of %s or %d.
6
Python Lesson 10
7
What’s new—Hint this is the long way, see if you can figure out the simple way.
8
New Stuff Function: a block of organized, reusable code that is used to perform a single, related action Float(): Also called floats, they represent real numbers and are written with a decimal point dividing the integer and fractional parts. Round(x,n): Rounds the number x, to the n digits from the decimal
9
Lesson 10 Activity You are to recreate slide 7 but add 4 more conversions. You should have all your inputs first , conversions second, and print out each conversion in a single print line using your escape sequences
10
Exit Slip Questions What is a function?
Write a line of code that converts Dollars to Cents.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.