Practical 1

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

Pakistan International School Jeddah - English Section

Y8-Computing
Unit 9.1: Presenting choices: Combining Constructs

Practical Task 1 Total Marks: 20

Name: Student ID: Y8 -____

Consider a chatbot is asking you how many hours you have free, what your favorite activity

is and how long your activity will take, and then output as a sentence how much time you

will have left when you have completed the activity.

1. Open the IDLE python from your computer.

2. Switch to script mode and make two variables with the name hours
Data Types:
using integer data type and an activity using string data type.  String
 Character
3. Make another variable with the name activity_Time using float data  Integer
 Real
type.  Boolean

4. Subtract hours from activity time to find out the total time left for

your activity.

5. Print the command that will tell you when you have completed an activity and how much

time left for your activity.

6. Save the program in python folder with name task 1

Evidence 1: Take the screenshot of python shell & script mode both and paste it in your
evidence file.

Y8-Computing 2023-24 Page 1 of 2


Y8 students want to log in to their accounts, they will enter the password. If the password is
correct the system should display a welcome screen else system should display Invalid password
and ask user to enter the password again until its correct.

7. Open a new file in python shell (Interactive mode) and put a comment

IF-ELSE statements allow more than one outcome

8. Open script mode and add two variables with name username and password using input

function.

9. Add IF-ELSE statement to display two possible outcomes;

if password==1234:

print ("Welcome Screen")

else:

print ("Invalid Password")

print (“Enter password again”)

10. Save the program as p1.py in your z-drive and ‘Run’ to execute the program in python shell.

Evidence 2: Take the screenshot of python shell & script mode both and paste it in your
evidence file.

11. Open draw.io software and make a flowchart of the above scenario.

Evidence 3: Take the screenshot of flowchart from draw.io and paste it in your evidence
file.

12. Save your Evidence file and print your document. Make sure to add header with name,
student Id and class.

13. Write pseudocode of the same program in manuscript.

--------------------------------------------

Y8-Computing 2023-24 Page 2 of 2

You might also like