for subject in subjects:
    marks[subject] = eval(input('Enter the ' + subject + ' marks: '))
total = sum(marks.values())
average = float(total) / len(marks)
print('The total is ' + str(total) + ' and the average is ' + str(average))
how to calculate percentage in python