Learning Python Part 3

avatar

Hi fellow Hiveians,

Today I am closing in on the final lessons of python before I finish the material!

A1DF25B7EC794714A2FB39EDA417626A.png

Hive Divider Bar Text.png

Tail Eating

There are points where I haven’t been sure about the things I am learning, particularly as the lessons get more complicated but it’s getting better. I’m able to put the info from the lessons into my thoughts and get the questions correct which has been nice to see.

This functionality, init seems to be pretty useful so I need to explore how it can be used more but from what I understand thus far, it can be used to define things with multiple variables and pull a desired one out. I have been thinking of all of this in the context of the game I plan on developing so that’s been a nice lens to think through.

596998F1B5EB4B15BF3080D30E70F5D8.png

Even though the info is pretty basic, I do best with repetition and doing it myself instead of just reading it. I have been copying the model code and making my own spin on it.

667FAD019752471EA83A5E16D0BFDA89.png

The “r” section of the python code seems to be pretty important from what I can see. It’s got a lot of potential uses that I will be able to hopefully flesh out further in the coming days and weeks. This ability to decipher an email address from a bar of text was interesting to see how the background code is handled.

FD709B0BDF0E4C93A932399335445A31.png

The hardest part for me is when I have to create my own code entirely. These code challenges are really good in that they make you think and do some actual coding but they are sometimes really hard! Being difficult isn’t all that bad, especially because there are quite a few people willing to help so that’s been good. I’ve been stuck on this Fibonacci code sample for a long time and haven’t been able to focus on trying to get it solved.

A1DF25B7EC794714A2FB39EDA417626A.png

The first part of my code here was the better of the two. It’s my chronological second but you get the point. I was able to get closer to solving it by getting some help from others who were struggling to solve it but haven’t been able to quite figure it out yet.

FE25BFEE55FE48A6B322A56AB154B6AC.png

If you’re a python ace and have a tip of how I could improve my code, let me know! :D

B7E61EDE4A434E3C8E08D788C8E357C5.png

Hive Divider Bar Centered.png

Connect with me!

Do you want to get paid, in crypto, for searching the internet? Try using and signing up for Presearch to earn some great crypto! I've currently got 2,011 PRE tokens, with a market value of $36.57. It doesn't sound like a lot but when you search using sites like Google you get paid $0! Join Presearch to break Google's stranglehold on the internet searches. If you'd like to sign up, use my referral link!
https://www.presearch.org/signup?rid=513043

Posted with STEMGeeks



0
0
0.000
6 comments
avatar

Hello @cmplxty great tutorial . I would however like a source code at the end if possible ? That would be super helpful :)

0
0
0.000
avatar
(Edited)

Thanks! The code I am using for this is:

num = int(input())

def fibonacci(num):
#complete the recursive function
if num <= 1:
return 1
else:
return ((num-1) + (num-2))

print(fibonacci(num))

0
0
0.000
avatar

!WINE

0
0
0.000
avatar

lol thanks, could use some wine right about now!

I ended up solving the problem thankfully. I don't remember specifically what it was I had to do but it's done now!

0
0
0.000
avatar

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

You made more than 8000 comments. Your next target is to reach 8500 comments.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @hivebuzz:

Guess the producer of the "50 Million Block" and win HIVES
First Hive Power Up Day of 2021 - Get a Hive Power delegation
0
0
0.000