0

Print using arrays and if

Is there a short way to create a code stating that if "schedule" equals "8" for instance, that person's name should be printed. I was doing it but I wondered if there was a shorter way for that. https://code.sololearn.com/ciYqSZ7QBlBN/?ref=app

4th Nov 2018, 8:19 PM
Strovosky
Strovosky - avatar
2 Answers
+ 1
So you can try something like this https://code.sololearn.com/cqWIWUO4LQ86/?ref=app the code uses a Array of Object to store all names and schedules After just looks for each element in array who have a schedule with inserted number to print
4th Nov 2018, 10:58 PM
Anya
Anya - avatar
+ 1
Thanks a lot, that looks really helpful. Nonetheless, I don't fully understand all of the topics in that program, but they give me a good idea as to what to study next. 😉
5th Nov 2018, 12:33 AM
Strovosky
Strovosky - avatar