A. Read The Following Questions and Write Your Answer On The File Document Given (@3 Marks Each)

You might also like

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

NAME: DATE:

GRADE & SECTION: SCORE:

SUBJECT: Computer Science Parent’s Signature Teacher’s Signature


CHAPTER: Python
Semester 2 Worksheet 4

A. Read the following questions and write your answer on the file document given (@3 marks
each).
1. What is Python? Who invented it? And when?
2. To display a text message, what function do we use?
3. Invalid syntax detected on the program below. Why?
a=input("Enter any random number:")
if a==5:
print("The number is 5")
elif a>5:
print("The number you've entered is bigger than the target")
elif a<5:
print("The number is smaller than the target")
4. What is the difference between int() and float() in python?
5. Johnny is trying to make this code running, but he is unable to do so. Why? And give the
correct code!

signal=INPUT "Enter the signal color:"


if signal=red:
print("Stop")
else if signal="Yellow":
print=("Wait")
else:
print==Go

Sem 2 W4 || Page 1
B. Practical
You are to create a program in Python. Copy and paste the code in the evidence
document and submit through ManageBac!
1. Create a program where a user is able to insert the following:
• Name, [1]
• Class, [1]
• Section, [1]
• English mark, [1]
• Computer Science mark, [1]
• Mathematics mark, [1]
• Economic mark, [1]
• Bahasa Indonesia mark, [1]
• Accounting mark and [1]
• Mandarin mark. [1]
• Find the total mark [1]
• And find their average. [1]
• The program should check for the following conditions:
▪ If the percentage falls below 45, they are considered fail. [1]
▪ If the percentage is between 45 and 60, grade them as pass. [1]
▪ If the percentage is between 60 and 75, good. [1]
▪ If the percentage is between 75 and 85, very good. [1]
▪ If the percentage is between 85 and 100, excellent. [1]
▪ If the percentage is below zero or above 100, it’s an error. [1]

Sem 2 W4 || Page 2

You might also like