LEARNING TO CODE
Hi there! This is my side blog where I'm going to write about learning to code and my quest to start making picture books for kids :D
Tips and hints are welcome ^^
~Anmitsu
So while taking this Python course I keep running into these Tasks, where I'm not always sure or perhaps, better to say, I don't always understand what they want me to do exactly 🤔🤔🤔🤔🤔🤔🤔🤔
So this one I did without much of a problem because there was an example code.
# [ ] add a 3rd period parameter to make_schedule
def make_schedule(period1,period2,period3):
schedule = '[1st] ' + period1.title() + ', [2nd] ' + period2.title() + ', [3rd] ' + period3.title()
return schedule
student_schedule = make_schedule("math", "history", "science")
print("SCHEDULE: ", student_schedule)
But this Optional part makes me scratch my head
# [ ] Optional - print a schedule for 6 classes (Tip: perhaps let the function make this easy)
So I went about it adding more parameters to the function and adding one more variable
def make_schedule(period1,period2,period3,period4,period5,period6):
schedule = '[1st] ' + period1.title() + ', [2nd] ' + period2.title() + ', [3rd] ' + period3.title()
schedule_6 = schedule + ' [4th] ' + period4.title() + ' [5th] ' + period5.title() + ' [6th] ' + period6.title()
return schedule_6
student_schedule = make_schedule("math", "history", "science","art","history of Star Wars","astronomy")
print("SCHEDULE: ", student_schedule)
Since there is no answer provided
I'll scratch my head a little more and go to the next task.
~ Anmitsu