Skip to main content

Chapter 3a - Inputs

input() waits for the student to type a line. int(input()) turns that line into a number.

πŸ§ͺ Try it (type in the box under output, then Enter)
Among Us project

Numbers from the keyboard​

n = int(input())
print(n + 1)

Mini quiz β€” converting input​

Quiz

int and input

1 / 2

If the student types 3, what is the result?

int(input()) + 1

Pick an answer to see if you are right.

Challenge: add one​

Write plus_one(n) so it returns n + 1.

Mini quiz β€” input​

Quiz

input

1 / 2

What type does this return?

input()

Pick an answer to see if you are right.

Exercises​

Activity: Hello name

Write hello(name) so it returns Hello, plus the name (comma and space).

Expected for Ada:

Hello, Ada