0% found this document useful (0 votes)
7 views1 page

Programming The Computer - Activity Handout

This activity handout instructs Class 7 students to create a Python program for calculating average marks of a subject. It outlines steps including user input for subject name and marks, calculation of percentage, and outputting results as PASS or FAIL based on the score. Students are required to save their code and print it for submission.

Uploaded by

taimoor khan
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)
7 views1 page

Programming The Computer - Activity Handout

This activity handout instructs Class 7 students to create a Python program for calculating average marks of a subject. It outlines steps including user input for subject name and marks, calculation of percentage, and outputting results as PASS or FAIL based on the score. Students are required to save their code and print it for submission.

Uploaded by

taimoor khan
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
You are on page 1/ 1

Activity Handout: Programming The Computer (Python) Class 7

Activity Handout of Programming The Computer

In this activity you have to code a program for a simple subject average marks calculation using Python.

1. Open python IDLE from desktop.


2. First line of code should contain the python comment with your name, section and a suitable name for
the program.
3. You can refer to the image at the bottom of this document as how your program output should look like
after execution.
4. Declare a variable “Subject” with user input with a message “Enter the subject name:”
5. Declare a float variable “Exam” with user input with a message “Enter the Exam marks obtain in
“Subject” (Add subject variable declared in previous line to display a proper message)”
6. Declare a Course Work float variable as “CW” with user input with a message of "Enter the marks
obtain in course work:"
7. Declare a variable “Percentage” and set its value by calculating the variables of “Subject” and “Exam” to
get the average percentage by dividing it with 2.
8. Print a string value along with the “Percentage” variable to show the output of the program. Place the
variables of Subject and Percentage in the string value in a way that it should like a sentence as shown in
the picture below.
9. Print the result as PASS or FAIL using the “if” and “elif” conditions. If the score is less than 60 it should
say FAIL and if the score is equal to or greater than 60 it should say PASS.
10. Convert your complete code into a function with any suitable name and then execute it.
11. Save your program as <<your name>>.py
12. Take the printout of the program code and file it in your activity file.
Sample Program Output

The City School/Academics/Computing Curriculum/Class 7/2021-2022 Page 1 of 1

You might also like