Return...return... python diary #4

in #python6 years ago (edited)

returnreturn.jpeg

Dear Diary,

I'm back :D Who would have thought that a cold at the end of October would lead to a surgery last week? I certainly didn't. Now I'm sitting at home with a tissue to stop a nosebleed. It's surreal. But now there is time to continue learning, and see how much had settled in my head.

Of course, the best way to check that would be to do one of the edX tasks... since they often omit some explanations and you have to do some guesswork/head scratching ^^;

Since I've started the conditionals and learned more syntax, the task reflects that as well and works as a brush up for some function stuff... Conditionals are quite easy to understand so far :D The problem of course again lies in the fact that I don't know functions very well yet.

Where do you use/add return inside a function with conditionals?


First I tried to write it like this (as per previous conditionals examples on edx):



Buuuut... yeah.... since I didn't add a return anywhere, the function returns None.

I tried to add it here and there for a while to see how it would go, but after giving up and googling the answer turned out to be a lot more trivial... Wha??? Is that where you stick <strmore: turn? Pretty anticlimactic, (-_-;) and sort of enlightening. Ha! I should play around more :B


Things that I learned about functions (and then noticed some more mistakes) this time are:

  1. The function above has a ton of mistakes in it xD
  2. You can use one of the parameters inside the input (omg! why didn't I think of it myself and nobody told me?? :D)
  3. Return works with strings without any extra blings around it (ohohohohoh)
  4. Functions can do something or give out a result.
  5. Don't use weird names for codes like deku_quiz.
  6. Codeacademy has better explanations than edX. edX is better for playing around blind and learning how to swim.
*image source Boku no Hero Academia.

Any other tips or fun tasks with functions are appreciated :D huhuhu

(Of course, I made more mistakes than I thought and thanks to Andikki <3 I found most of them)

~ Anmitsu


Posted from my blog with SteemPress : https://anmitsu.club/2018/12/07/return-return-python-diary-4/

Sort:  

Learning to code gives nosebleeds? :(

I'm a pretty allergic to most code these days, but I'm glad to see others venturing down the path of talking to computers in a language they can understand. Good luck!

Ahahaha @abh12345 no.
The nosebleed is independent of that. More like I’m learning because I have a two week medical leave from life and there is just nothing more interesting to do but read, learn Python and binge watch some shows :)
How come you’ve become allergic to most code?

:)

I don't know - too much time in front of a screen doing things that don't interest me, looking at the sunshine outside. Maybe next year I'll get my ass into gear and get on with it - it's a long way to go until retirement so I should probably be doing what you are doing - sans the binge watching of 'shows' :P

Hope you get feel better soon!! :)

@ramengirl :D thank you! hope you stay healthy and don't catch any colds like that ^^
also looking forward to some Korean style spaghetti recipes ;)

Congratulations @anmitsu! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You made more than 50 comments. Your next target is to reach 100 comments.

Click here to view your Board of Honor
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:

Saint Nicholas challenge for good boys and girls

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @anmitsu! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You received more than 10 as payout for your posts. Your next target is to reach a total payout of 50

Click here to view your Board of Honor
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:

Saint Nicholas challenge for good boys and girls

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @anmitsu! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You received more than 50 as payout for your posts. Your next target is to reach a total payout of 100

Click here to view your Board of Honor
If you no longer want to receive notifications, reply to this comment with the word STOP

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @anmitsu! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You got more than 50 replies. Your next target is to reach 100 replies.

Click here to view your Board of Honor
If you no longer want to receive notifications, reply to this comment with the word STOP

Support SteemitBoard's project! Vote for its witness and get one more award!