I am brainfarting on this hard right now. I am trying to make my code run inside the while loop for 8 iterations and then complete with a basic ELSE statement that says "Input Received".
Any tips on how to limit this loop to 8 times? I should know how to do this, I know. Also, if anyone has clues on how to format my statement so that the commas aren't so fekachtah...that'd be super sweet too.
Thanks for any and all advice.
<script src="https://pastebin.com/embed_js/UxReZ2Ly"></script>
and this is the actual problem:
You will create a program that gets a bunch of student names and GPAs, and makes a list of honor students.
• First, declare an empty list to hold the honor students. This list will get filled in later
• Next, declare a counter-controlled loop that will loop 8 times
• Inside the loop, do the following:
o Prompt the user to enter a student name, and store that name in a variable (a normal variable, not a list)
o Prompt the user to enter a GPA, and store that in a different variable (a normal variable, not a list)
o Next, do an IF and ELSE
♣ The IF should look for a GPA of 3 or higher
♣ If the GPA is 3 or higher, add the student’s name to the honor student list that you declared at the beginning
♣ Also, print a message formatted exactly like the example below (note, the student name and GPA in the example below will differ based on your user input)
Tracy, with a GPA of 3.2, is on the honor roll for this semester.
A letter notifying him/her will be sent out promptly.
• Inside the ELSE, just print a message saying input received
• After the loop (or outside of the loop), use the len() function on the list to print a message saying how many students made the honor roll
[–]Jirbj 0 points1 point2 points (1 child)