Printing in Python
Variables and Types
User Input
Mathematical Operators
String Operators
100

How do I write a print statement? Write on the board...

(Output -> Hello World)

print("Hello World")

100

How many types of variables have we learned about so far this year?

3

100

How do I get user input of a string? Write in on the board...

name of variable is csp

csp = input("Input a string: ")

100

What is the first thing we take care of in our order of operations?

Parentheses

100

How do we add two strings together?

Using the '+' sign.

200

What does the following Python code display?

print("Hello")

print("World")

Hello

World

200

What are the types of variables that we have learned so far this year?

String, Int, Float

200

How do I get user input of a int? Write in on the board...

name of variable is csp

csp = int(input("Input a string: "))

200

What does this operator mean?

%

Remainder (modulus sign)

200

What will the following code output?

print("Hello" + "" + "World.")

HelloWorld.

300

What will the following program print me?

print("Mr. Merlo = " + 5)

Error!

300

What types of variables are the following:

5.0

5

"5.0" 


Float

Int

String

300

How do I get user input of a float? Write in on the board...

name of variable is csp

csp = float(input("Input a string: "))

300

What does the // sign mean?

Integer division.

300

What will be output by the following code?

for x in range(4):

   print("Merlo")

Merlo

Merlo

Merlo

Merlo

400

What will this print?

print("")

A blank line.

400

Tell me why all integers/floats can be strings, but not all strings can be integers/floats.

Because letters cannot be turned into numbers, python will give us a typeError.

400
What would be the output of this program if the user enters 7?


var = float(int("What is your integer?"))

print(var)

7.0

400

What is (9*3+37%11*3//4)?

30
400

What will be the output of this program?

for x in range(2):

   print("Merlo" * (2 + 8 // 3 / 2))

MerloMerloMerlo

MerloMerloMerlo

500

What will this print?

for x in range(4):

   if x != 3:

      print(x)


0

1

2

500

What will be the output of my program?

1variable = 24

print(24)

Error.

500

What is the output of my program if my user enters 6?

var = float(int(input("What is your integer?"))**2)

print(var)

36.0

500

What is 345%10*9+6*45//9?

75

500

How many mathematical operators can we perform on strings w/ other strings or integers?

2, '+' and '*'.

M
e
n
u