Python Project

COMP123 – INTRODUCTION TO PROGRAMMINGCOMP123
Deanship of Preparatory Year and Supporting Studies
Department of Computer
Homework
Introduction to Programming
(Individual)
Submission Date:
Total Marks 10
Weightage 10%
Until March 27, 2022 @ 11:59PM
Instructions:
i.
ii.
iii.
iv.
Read through the whole description below before starting with the homework.
You can refer to the links provided at the end of the homework for help.
It is strongly recommended that you try to solve the assignment yourself. Only if you are
stuck and absolutely cannot get an idea should you search your issue on
https://stackoverflow.com/
In case you use more than one python file (.py) to complete this homework, then zip your
files and upload the zip folder.
Q1. The following string data is given to you:
(3 Marks)
“Saudi Arabia traces its roots back to the earliest civilizations of the Arabian Peninsula. On September
23, 1932, King Abdulaziz Al-Saud established the Kingdom of Saudi Arabia, an Islamic state with Arabic
as its national language and the Holy Qur’an as its constitution.”
Save this data in a variable and write python code to extract the exact data from the string variable:
Note: For total characters in string see len()function.
1
COMP123 – INTRODUCTION TO PROGRAMMING
Q2. Create a variable of list data type, which stores the following data:
student name (string), student id (number), section number (string), subject (string), marks (float).
(3 Marks)
a) Write python code to generate exactly the following output:
Make sure you write your own data (your name, your ID and so on.). You can write any subject
name and marks.
b) Now add another value to your list, which is grade (string). Your new output should look like the
following:
Note: For adding grade to your list see append()function. Do not add grade value manually,
make sure you use append function. You can write any value for grade (A+, A, or B+).
2
COMP123 – INTRODUCTION TO PROGRAMMING
Q3. Write a python code that takes total marks as input from the user (integer or float) and calculates
the grade according to the following table:
(4 Marks)
Grade
Total Marks
A+
95 or above
A
90 – 94
B+
85 – 89
B
80 – 84
C+
75 – 79
C
70 – 74
D+
65 – 69
D
60 – 64
F
less than 60
Note: The total marks entered by the user are rounded to the nearest integer before assigning them a
grade. For rounding marks see round()function.
For example:
Reference Material:
References related to Python for Everybody Book:
https://www.py4e.com/lessons/
https://www.py4e.com/lessons/lists
External References:
https://www.learnpython.org/
https://www.w3schools.com/python/default.asp
3

Calculate your order
275 words
Total price: $0.00

Top-quality papers guaranteed

54

100% original papers

We sell only unique pieces of writing completed according to your demands.

54

Confidential service

We use security encryption to keep your personal data protected.

54

Money-back guarantee

We can give your money back if something goes wrong with your order.

Enjoy the free features we offer to everyone

  1. Title page

    Get a free title page formatted according to the specifics of your particular style.

  2. Custom formatting

    Request us to use APA, MLA, Harvard, Chicago, or any other style for your essay.

  3. Bibliography page

    Don’t pay extra for a list of references that perfectly fits your academic needs.

  4. 24/7 support assistance

    Ask us a question anytime you need to—we don’t charge extra for supporting you!

Calculate how much your essay costs

Type of paper
Academic level
Deadline
550 words

How to place an order

  • Choose the number of pages, your academic level, and deadline
  • Push the orange button
  • Give instructions for your paper
  • Pay with PayPal or a credit card
  • Track the progress of your order
  • Approve and enjoy your custom paper

Ask experts to write you a cheap essay of excellent quality

Place an order