NEW
Font size
WorksheetsWriting your first program in Python
Total questions: 10
Worksheet time: 5mins
What is the purpose of the print() function in Python?
To save a program
To display text on the console
To create variables
To upload files
Which of the following is a correct way to write a comment in Python?
/* This is a comment */
// This is a comment
# This is a comment
<-- This is a comment -->
What will the following code output? print('Hello World')
Hello World
Hello, World!
Hello World!
Hello
What is the output of the following code: print(3 * 4)?
34
12
7
3 x 4
What is the first step to create a Python program according to the text?
Run the program
Write the code
Open the Python editor
Save the program
Which of the following is NOT a feature of Python mentioned in the text?
Open source
Rich library of functions
General-purpose programming language
High cost
What will the following code output? print('100-99=', 100-99)
100-99=1
1
99
100-99=0
What is the purpose of the Run button in the Python editor?
To upload files
To clear the editor
To execute the program
To save the program
What is the output of the following code? print('3 + 10 = '); print(3 + 10)
3 + 10 = 13
3 + 10 = 30
3 + 10 = 10
3 + 10 = 3
What is the output of the following code? print('The product of 8 and 3 is 8x3')
The product of 8 and 3 is 8/3
The product of 8 and 3 is 8*3
The product of 8 and 3 is 8x3
The product of 8 and 3 is 24
