NEW
Font size
WorksheetsClass 8A Unit 9.1 Python Basic
Total questions: 20
Worksheet time: 10mins
Which of the following best describes Python?
Python is a high-level and interpreter based programming language.
Python is a high-level programming language
Statically-typed programming language
What is an object-oriented programming language?
A language based on objects and lacking classes
A language that uses only procedures and functions
A language that supports objects, classes, and inheritance
A language used only for web development
Which statement is true about Python?
Python is primarily used for system programming
Python does not support object-oriented programming
Python can be used for web development, software development, and data science
Python codes are compiled before execution
What does an 'if' statement in Python do?
It stops the program
It repeats a block of code multiple times
It declares a variable
It makes a decision based on a condition
What is the correct way to start an 'if' statement in Python?
if (condition)
if condition:
if [condition]
if condition;
Which of the following is an example of an 'else' statement in Python?
else condition:
else (condition)
else:
else [condition]
What is a loop in programming?
A syntax error
A way to repeatedly execute a block of code
A condition statement
A function declaration
What is the output of the following Python code?
if 5 > 3: print("Hello") else: print("Bye")
Hello
Bye
Error
No output
What keyword is used to check multiple conditions sequentially in Python?
switch
for
check
elif
Which of the following correctly declares a variable in Python?
int x = 10
var x = 10
x = 10
declare x = 10
What symbol is used to start a block of code in Python?
{
(
:
;
Which operator is used to compare two values?
=
==
===
!=
What is the result of the following code if the input is 10?
x = int(input())
if x < 20: print("Less than 20") else: print("20 or more")
Less than 20
20 or more
Error
No output
What will be the output?
name = 'Dave'
print (name)
name
(name)
Dave
'Dave'
Which of these would work as a piece of code?
IF answer == "Yes":
if answer == "Yes"
if answer= = "Yes":
if answer = "yes":
What syntax would you use to create a name variable?
name=INPUT
name=input{}
name=input()
input=name
What is the answer to print( 12/6)?
2
6
10
1
In the following code, n is a/an _______?
n = '5'
tuple
integer
string
operator
What will the output be from the following code?
print("3+4")
SyntaxError
7
3+4
34
Which is the Python logo?
