0% found this document useful (0 votes)
55 views4 pages

Python Programming Worksheet

Worksheet

Uploaded by

ayooni36
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views4 pages

Python Programming Worksheet

Worksheet

Uploaded by

ayooni36
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

PYTHON PROGRAMMING WORKSHEET

NAME___________________________________
CLASS____________________________________
ANSWER ALL QUESTIONS.
1. Which statement uses the correct python syntax?
(A) Print("Hello World!")
(B) print("Hello World!")
(C) primt ("Hello World!")
(D) print (Hello World!)
2. Variables store different types of data.
(A) True
(B) False
(C) May be
(D) I do not know
3. Which statement uses the correct python syntax?
(A) Print("Hello World!")
(B) print("Hello World!")
(C) primt ("Hello World!")
(D) print (Hello World!)
4. Variables store different types of data.
(A) True
(B) False
(C) May be
(D) I do not know

1
5.

What would the outcome of this program above be?


(A) 22
(B) 50
(C) Nothing, it will cause an error
(D) 38
6. A price, such as 3.95 should be saved as which type of variable?
(A) String
(B) Integer
(C) Float
(D) Decimal
7.

Use the above code to answer questions 36 to 39


8. What would the output of this code be if the user entered the value 70?
(A) Distinction
(B) Merit
(C) Pass
(D) Fail

2
9. What would the output of this code be if the user entered the value 50?
(A) Distinction
(B) Merit
(C) Pass
(D) Fail
10. What would the output of this code be if the user entered the value 58?
(A) Distinction
(B) Merit
(C) Pass
(D) Fail
11. What would the output of this code be if the user entered the value 40?
(A) Distinction
(B) Merit
(C) Pass
(D) Fail
12. Which command will correctly ask the user for their age?
(A) input(“How old are you?”) = age
(B) input = print(“How old are you?”)
(C) age = int(input(“How old are you?”))
(D) age = input(“How old are you”)
13. Which function will convert a number to a string?
(A) int()
(B) str()
(C) float()
(D) num()

3
14. What is the result of this command? print(“5” + “3”)
(A) 8
(B) “5” + “3”
(C) “8”
(D) 53
15. What does input allows you to do?
(A) It allows users to change the program
(B) It converts one data type to another (str to int)
(C) It prompts you to enter data
(D) It does nothing
16. myName = input(“what is your name?”). What is myName in this line?
(A) String
(B) Function
(C) Variable
(D) Method
17.

In the program above, what are the names of the variables used?
(A) print & name
(B) name & game
(C) name & input
(D) game & input

You might also like