WorksheetsAssessment block 2 programming Edexcel
Total questions: 30
Worksheet time: 19mins
What is this diagram called?
Truth Table
Gate Table
Output Table
Input Table
What is >= ?
What is < ?
Comparison Operators
What is A > B?
A greater than B
A less than B
Greater than or equal to
Less than or equal to
What is != ?
What does the isdigit() function do in Python?
Returns True if all the characters in the string are in capital letters
Returns True if all the characters in the string are in small letters
Returns True if the string contains only spaces
Returns True if all the characters in the string are digits
Which code would get the characters from position 2 to position 5 (not included).
x = txt[2:5]
x = txt[1:5]
x = txt[1:4]
x = txt[0[:4]
Convert the value of txt to upper case.
x = txt.upper()
x = txt.lower()
x = upper(txt)
x = upper.txt()
What is the result of 'Char(65)'?
The number 65
The character 'A'
The ASCII value 65
The string '65'
What is the correct way to convert a string to lowercase in Python?
.lower()
.lowercase()
.small()
.toLower()
How is the condition for a while loop evaluated in Python?
The condition for a while loop in Python is evaluated before each iteration.
The condition for a while loop in Python is evaluated only once at the beginning.
The condition for a while loop in Python is not evaluated at all.
The condition for a while loop in Python is evaluated after each iteration.
Explain the difference between 'while' and 'for' loops in Python.
The 'while' loop is used for iterating over a sequence, while the 'for' loop is based on a condition.
The 'while' loop is only used for strings, while the 'for' loop is used for numbers.
The 'while' loop is based on a condition, while the 'for' loop is based on iterating over a sequence.
The 'while' loop is used for counting, while the 'for' loop is based on iterating over a sequence.
if len(password) < 8:
print ("Your password is not valid!")
This is an example of :
What will be the output after the following statements?
true
not false
false
not true
error
Example of ...?
Nested selection
Nested loop
Repetition
Iteration
If the user enters the colour: black and the suit: hearts. What will the output be of this program?
My card is a match
My card is not a match
What is the output of 'Hello'.length?
Hello World
6
4
5
What does the 'strip()' method do in Python?
The 'strip()' method removes leading and trailing whitespace from a string.
The 'strip()' method splits a string into a list of words.
The 'strip()' method converts a string to uppercase.
The 'strip()' method adds whitespace to a string.
s=lower("INDIA)
print(s)
the output will be:
India
india
INDIA
INDIA
For strings, the + operator represents
Concatenation
Addition
Appending
Recantation
Yes
What data type would True and False be
Integer
String
Boolean
Float/Real
