T - 8 - 4 Python Programming2

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Name : Date of issue : 28/06/2022

Class : 8 Date of submission : 29/06/2022


Subject : ICT Worksheet No : 03
Topic : Python programming Assessed By : Teacher

I. Choose the correct answer:


1. Which command will display the text 'Hello world!' on the screen? ( C)
a. print(Hello world!) b. print "Hello world!"
c. print("Hello world!") d. print = "Hello world!"

2. Which command will correctly ask the user for their age? ( A)

a. age = input("How old are you?") b. age = input(How old are you?)

c. input("How old are you?") = age d. How old are you = input()

3. Which function will convert a string to a number? ( A)

a. int() b. str() c. ord() d. chr()

4. What is the result of this command? print ("5" + "3") ( D)

a. 8 b. "5" + "3" c. "8" d. 53

5. Which decision statement will be triggered if the variable x is less than 20? ( D)

a. if x > 20: b. if x <> 20: c. if x == 20: d. if x < 20:

6. Which of these tests whether the variable x is the same as 'Hello'? ( a)

a. x = "Hello" b. x != "Hello" c. x == "Hello" d. x <> "Hello"

7. What is a variable? ( B)

a. A piece of data that can change b. A piece of data you cannot change

c. A coding technique d. A special file

8. What does input do? ( D)

a. It allows users to change the program b. It converts data types

c. It allows a user to solve a task d. It allows users to enter data

9. What is the word (command) used to display numbers and text on the screen?( A)

a. print b. input c. output d. command


10. What is the word (command) used to read values into variables from the user?( B)

a. print b. input c. output d. command

You might also like