0% found this document useful (0 votes)
4 views2 pages

Week 7.1

Uploaded by

shitendu.some
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)
4 views2 pages

Week 7.1

Uploaded by

shitendu.some
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

SR UNIVERSITY

SCHOOL OF COMPUTER SCIENCE AND ENGINEERING

Course- B.Tech Type- Programming Elective


Course Code- Course Name- Problem Solving using Python
Year- 2024-2025 Semester- Odd
Date – 9th September 2024 Batch – All batches
Week 7.1
A. Unicode
Write a Python function that displays the characters corresponding to Unicode values in the
following ranges: 48 to 57 (digits '0' to '9'), 65 to 90 (uppercase letters 'A' to 'Z'), and 97 to
122 (lowercase letters 'a' to 'z')
B. Unicode – Strong or Perfect
Write a Python function that checks Unicode values from 50 to 500 and displays the corresponding
character if the Unicode value is either a strong number or a perfect number.

C. Student result
You are developing a system to classify student results into four categories: Fail, Pass, Merit, or
Distinction based on their scores. Each score is provided as part of a string that includes both the
student's name and their score. The system should extract the score from the string, classify it, and
provide a summary of the results.
Write a Python program that processes a list of student result strings. Each string contains a
student's name and score in the format "Name: Score". The program should extract the score from
the string and categorize it as Fail, Pass, Merit, or Distinction. The program should use a function
to perform the classification and provide a summary report at the end.
Result Categories:
• Fail: Below 40
• Pass: 40 to 59
• Merit: 60 to 69
• Distinction: 70 and above
Requirements:
1. String Processing:
o Extract the score from each string. The score follows the format "Name: Score",
where Score is a numeric value.
o Convert the score to an integer for classification.
2. Function Definition:
o Create a function classify_grade(score) that takes the extracted score and returns
"Fail", "Pass", "Merit", or "Distinction" based on the defined grade categories
Input :
student_results = [
"Aarav: 55",
"Riya: 78",
"Anjali: 83",
"Vikram: 62",
"Kiran: 49",
"Ishaan: 90"
]
Output:
Aarav: Pass
Riya: Merit
Anjali: Distinction
Vikram: Merit
Kiran: Pass
Ishaan: Distinction
Summary:
Fail: 0
Pass: 2
Merit: 2
Distinction: 2

You might also like