Pakistan International School Jeddah - English Section
Y7-Computing
Practical 7
Name:
Total Marks: 15
Obtained Marks:
Y7 -____
Student ID:
Date:
Input means when user enters data on their
Keyboard in Python. This is done in Shell mode
Task 1
1. Open a new file and save it with the name variable in Z-drive.
2. Make a comment and write Task 1 in it
3. Output the sentence “My Details” on the screen.
4. Make a variable called name. Ask the user to input their name and store
it in that variable. Since name is a string, you will use the datatype string
for this. See the code below
Data Types
•
•
•
•
Integer
Float
Character
String
name=str(input(“Enter Your name”))
5. Make a variable called age. Ask the user to input their age and store it in that variable. As
age is a number, you will use the datatype integer for this. See the code below
age=int(input(“Enter Your Age: ”))
6. Display a message telling your name. You will use strings and variables together as shown
below:
print (“My name is : ”, name)
7. Similarly, Output your age with a message.
8. Run your program and see the output
Evidence1: Open the evidence file from Z drive (inside Practical 7 folder) Paste the screenshots
of both script and shell window
Y7-Computing 2024-25 Practical 7
Page 1 of 2
Task 2
1. Open a new file in the IDLE and save it with the name average in Z-drive.
2. Write your Name in a comment.
3. Write Today’s date in a comment.
4. Show the message “Average marks of a student” on the screen.
5. Ask the user to input their name and store it in a variable. Give the variable any suitable
name. (See step 4 of Task 1 to see how to do this)
6. Display a message on the screen that shows two strings and the variable you made for
user’s name. Below is the code for this
print (“ Hello”, variable, “Welcome to the program ” )
Here, type the variable you made in step 5
7. Ask the user to input their science marks and store them in a variable. Give the variable any
suitable name (for example science).
science=int(input(“Enter Science Marks: ”))
8. Similarly Ask user to input marks in Maths and English and store in suitable variables.
9. Add the marks of Science, Math and English and save them in a variable (for example,
total_ marks).
10. Find the average by dividing the total marks by 3.
average= (science + maths + english) / 3
11. Display the Average marks with a message “The average marks are” (see task 1 step 6)
Evidence 2: Paste the screenshots of both script and shell window
12. Run your program and see the output
13. Save your Evidence file and add header with name, student ID and class.
14. Print the evidence file.
Y7-Computing 2024-25 Practical 7
Page 2 of 2