
S4: Arrays and Input Validation
Authored by Kieran Kyle
Computers
11th Grade
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
11 questions
Show all answers
1.
DRAG AND DROP QUESTION
1 min • 1 pt
What is the format of the following arrays:
["apple", "banana", "grape"] (a)
[True, False, True, False] (b)
[3.14, 2.71, 1.62] (c)
2.
CATEGORIZE QUESTION
3 mins • 1 pt
Identify the following statements as related to either '1D arrays' or 'Input Validation':
Groups:
(a) Checking if an email contains an "@"
,
(b) Accessing the third element using index
Input Validation
1D Arra
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In Python, to ensure that an inputted age is between 0 and 100, which conditional statement is correct?
if age < 0 and age > 100
if age > 0 or age < 100
if 0 <= age <= 100
if age == 0 or age == 100
4.
MATCH QUESTION
1 min • 1 pt
Match the following
Validating if an input is an integer
arr = ["a", "b", "c"]
Input validation
if type(value) == int
1D Array
Ensuring a user enters a valid age between 0 and 120
Declaration of a 1D array
Storing multiple values in a single data structure
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the array:
fruits = ["apple", "grape", "banana"]
What will fruits[0] return?
Apple
Grape
Bannana
Error
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a type of input validation?
Concatenation
Range check
Iteration
Addition
7.
REORDER QUESTION
1 min • 1 pt
Reorder the following
print("Valid number entered.")
if 1 <= num <= 10:
num = int(input("Enter a number between 1 and 10: "))
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?