Learning to code in Python 3 - diary #1
LEARNING TO CODE
in PYTHON 3
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
Two weeks ago
I have to say I never expected it to be that exciting. Years ago I tried to learn JS with Code Academy, but couldn't get past some things. That course seemed extremely confusing and I gave up quickly. I did play a simple coding game, I think it was from Google, where you had to get the pin from point A to point B using the route provided. I'd race a friend who was an actual programmer, to see who could do it in fewer steps.
Even though I'd beat her quite often, it never went further than that.
After a certain life event, my brain was shouting that it needs to learn and crack something. And while I wasn't sure what to learn, I felt like doing some logic, which is super fun. One thing led to another and here I am, learning to code in Python 3 ^^.
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.
Ideas and explanations welcome :D
~ Anmitsu
Leave Learning to code in Python 3 - diary #1 to:
Read more #learning posts
Best Posts From anmitsu
We have not curated any of anmitsu's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From anmitsu
- The loops of spring.
- Make your feed filled with pancakes again! Join in the pancake battle.
- Python Practice
- Git, sudo and alias adventures on an updated macOS Sierra.
- Return...return... python diary #4
- Intro post - I like spaghetti 🍝
- Building bridges across eternity, borrowing books at Openlibrary.org
- testing the code insert
- test post 2 with images
- learning Python 3 diary#3
- Learning to code in Python 3 diary #2
- Learning to code in Python 3 - diary #1