Inputs

Inputting Strings (Text)

variable name

your question

name = input("What is your name? ")

print ("It's lovely to meet you " + name + ".")

a plus to separate parts

What is your name? Montgomery

It's lovely to meet you Montgomery.

Press F5 to run program:

Inputting Integers (whole numbers)

variable name

int stands for integer (whole number)

your question

double brackets

slices = int(input("How many pizza slices do you want? "))

print ("What?! You want " , slices , "whole slices?")

a comma to separate parts

Press F5 to run program:

How many pizza slices do you want? 11

What?! You want 11 whole slices?

© CSNewbs 2020