Oct-16-2016, 12:16 PM
thank you to you both!
I am obviously new to this, great to have some excellent and fast feed back from the two of you!
P.S. this is for my python class, but did not put in to the home work section because I thought the question was specific enough to be here.
If you two are able to help me with my next section of making a function that adds the inputs from the list we just created, that would be much appreciated (have been working on this for a couple of days now, cant seem to get the list to add on properly)......
I am obviously new to this, great to have some excellent and fast feed back from the two of you!
P.S. this is for my python class, but did not put in to the home work section because I thought the question was specific enough to be here.
If you two are able to help me with my next section of making a function that adds the inputs from the list we just created, that would be much appreciated (have been working on this for a couple of days now, cant seem to get the list to add on properly)......
#creating a loop to ask for additional student inputs def classlist(): itemList = [] stud = student() itemList.append(stud) anyM = input("Any more students in your class? (yes/no) ") if anyM == "yes": stud = student() itemList.append(stud) if anyM == "no": return itemList while stud: #something about this while loop is not working when i input no anyM = input("Any more students in your class? (yes/no) ") itemList.append(stud) if anyM == "yes": anyM = input("Any more students in your class? (yes/no) ") itemList.append(stud) if anyM == "no": return itemList print(classlist())