A programme that accepts name, age of students and score in 4 units

1 Answer

0 votes
answered May 23 by (270 points)
import array

sub=['s']
marks=['1']
maxmarks=['1']

stname=str(input('Enter Student Name : '))
stage=int(input('Enter age of Student : '))
stclass=str(input("Enter Student's Class : "))
stschool=str(input('Enter school Name : '))

n=int(input('Enter Number of Subjects : '))

for x in range(1,n+1):
    
    s=str(input('Enter subject Name : '))
    k=24-len(s)
    for l in range (1,k+1):
        s=s+' '
    sub.append(s)
    
    j=int(input('Enter max marks in the subject : '))
    maxmarks.append(j)
    
    j=int(input('Enter marks obtained in the subject : '))
    marks.append(j)
    
print('\n')
print('\n')    
print('\n')
print('\n')    
print('\n')
print('\n')    
print('\n')
print('\n')    
print('\n')
print('\n')    
print('\n')
print('\n')    
print('\n')
print('\n')    
print('\n')
print('\n')    

print("Student Name         :{0}".format(stname))
print("class                :{0}".format(stclass))
print("Age of student       :{0}".format(stage))
print("School Name          :{0}".format(stschool))

print("---------------------------------------------------")

print('\n')
print('\n')

print("---------------------------------------------------")
print("|Subject Name            |Max Marks|Marks Obtained|")
print("---------------------------------------------------")

for x in range(1,n+1):
    print("|{0}|  {1}    |  {2}          |".format(sub[x],maxmarks[x],marks[x]))
    print("---------------------------------------------------")

print('\n')
print('\n')

print("Class Teacher                            Principal")

or sharing online

https://onlinegdb.com/Hy4ZZDLj8

by Dinesh Sen
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...