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β
int and input
1 / 2If 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β
input
1 / 2What 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