AEIMA’s Online Courses

AEIMA’s Online Courses

AEIMA’s collection of professional development courses is the ideal solution for today’s busy professionals who do not have time to sit in a conventional classroom, yet want a high-quality education in professional development front.  AEIMA’s online courses are offered exclusively online and are to be completed through self-paced study.  AEIMA does not have a formal enrollment process. All the courses are available to all the students and a student may choose to purchase one or more courses or all of them.  Write a program in Python to create a report for a student, on his course completion. The report must contain the no. of courses, course names and his mark pertaining to each course. However, the report displayed to the student must only contain the details of the course(s) in which he has scored 80% and above.

Note:

  • If the user enters no. of courses to be less than 1, then display “Invalid no. of courses” and terminate the program
  • If the mark specified is less than 0 or greater that 100, display “Invalid mark” and terminate the program.

Sample Input 1:Enter number of courses: 4
Enter name of the subject and marks respectively:
Python
98
Enter name of the subject and marks respectively:
C Programming
79
Enter name of the subject and marks respectively:
Java
85
Enter name of the subject and marks respectively:
C#
56

Sample Output 1:
The courses you have cleared are:
Python 98
Java 85

Sample Input 2:

Enter number of courses: 2

Enter name of the subject and marks respectively:

Java

-1
Sample Output 2:

Invalid mark

Sample Input 3:

Enter number of courses: 0

Sample Output 3:

Invalid no. of courses

Sample Input 4:

Enter number of courses: 3

Enter name of the subject and marks respectively:

Mathematics

22

Enter name of the subject and marks respectively:

Science

101

Sample Output 4:

Invalid mark

Code :-

n=int(input("Enter number of courses: "))
d={}
if n>=1:
    for i in range(n):
        print("Enter name of the subject and marks respectively:")
        name=input()
        mark=int(input())
        if mark<0 or mark>100:
            print("Invalid mark")
            exit()
        d[name]=mark
    print("The courses you have cleared are:")
    for key,value in d.items():
        if value>=80 and value<=100:
            print(key,value)
else:
    print("Invalid no. of courses")

1 thought on “AEIMA’s Online Courses”

  1. Hi, I do think this is a great website. I stumbledupon it 😉
    I am going to return once again since i have bookmarked it.
    Money and freedom is the best way to change, may you be rich and continue to guide other people.

Leave a Comment

Your email address will not be published. Required fields are marked *

x