I2P(S)-Simon Kye-Weekend Mini Project




For this weekend miniproject, this took me quite a while to finish. I chose the option of how to get to school. The flowchart is pretty self explanatory. The code is basically what the flow charts says with all the options added on there, but I also refined it to make it better. I made sure the code did variabe.lower() to make sure a person could write yes or Yes or no or No. I also added a else for every option saying ‘I do not understand what you are saying’. The variables I chose were purposely very short to make it simple and easy to identify. The code isn’t only comprised of if variable == ‘yes’ or ‘no’ statements, there are some that checks which station or bus number you need to take. There is also a while loop in the code. Basically what the while loop does here is during the question asking public or private transportation, because there are literally only two options and nothing else, just like how the flowchart shows, it loops if both public or private is chosen as false instead of printing something like ‘You have to choose between private or public’ and ending the code, it loops. I would’ve done this for all of my options but it would’ve been even longer and more time consuming. I hope this demonstrates my knowledge of while loops. I tested out my code several times and worked perfectly.

Leave a Reply