Answer to Question #259195 in Python for Neel

Question #259195

4.4 Write a program which reads the social security number SOC of a student and uses LINEAR to find and print the student's record. Test the program using (a) 174-58-0732, (b) 172-55 5554 and (c) 126-63-6382.


1
Expert's answer
2021-10-30T23:56:25-0400
n=int(input("Enter number of students: "))


soc=[]
names=[]
address=[]
course=[]


for i in range(n):
    print("Enter details for student ",i)
    s=input("Enter social security number: ")
    soc.append(s)
    n=input("Enter student name: ")
    names.append(n)
    a=input("Enter student address: ")
    address.append(a)
    c=input("Enter course: ")
    course.append(c)


num=input("Enter social security number of the student: ")
print("The student record is as follows: ")
index=0
for i in range(n):
    if(soc[i]==num):
        index=i


print("social security code: ",num);
print("Name: ",names[index]);
print("Address: ",address[index]);
print("Course: ",course[index]);



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog