Answer to Question #178328 in Python for tas

Question #178328

Write a program to get input from a student for their name, how many subjects they want to register, and the subject name. Your program should only ask to enter the subject name according to the number they provide. (Use loop concept). If they want to register for five subjects, your program should ask for the input for the subject name only five times


1
Expert's answer
2021-04-07T08:53:53-0400
#get input from a student for their name, how many subjects they want to register,
studentName=input("Enter your name: ")
numberSubjects=int(input("How many subjects do you want to register?: "))
#ask to enter the subject name according to the number they provide. 
for i in range(0,numberSubjects):
    subjectName=input("Enter subject name: ")

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
APPROVED BY CLIENTS