Lesson details
Key learning points
- In this lesson, we will start to add interactivity to our programs by using the input() function. Whilst learning about input, we will be introduced to functions and data validation techniques. These will be covered in more detail later on in the course.
Licence
This content is made available by Oak National Academy Limited and its partners and licensed under Oak’s terms & conditions (Collection 1), except where otherwise stated.
Loading...
3 Questions
Q1.
Which of these variable names would be most suitable to hold data on a person's surname in Python?
lastName
Surname
x
Q2.
Which naming convention is used for a constant in Python?
All lower case (e.g. myconstant)
All lower case with words separated by an underscore (e.g. my_constant)
All upper case (e.g. MYCONSTANT)
Q3.
F strings allow you to display variables within print statements. Which TWO symbols are needed for an f string to work?
*
s
3 Questions
Q1.
Select the data below that is of the data type: Boolean
"Boolean"
1.0
4/5
Q2.
Select the data below that is of the data type: Real / Float
"D"
"Hello"
456
Q3.
Which of the code snippets below will assign an integer value to a variable.
number = "5"
number = input()
number = integer()