[Finxter Article Recommender] How to Get Started with Python?

Don’t know where to start to learn Python? Check out the Finxter article recommendation engine: simply run the Python code and answer the questions. The engine will then recommend the best articles for you that match your skill level:

'''FINXTER TUTORIAL RECOMMENDATION ENGINE
Execute This Python Script in a Python Shell'''

import webbrowser

# questions
experience = int(input("Guess your Python experience level (0: beginner, 10: master)\nType a number (0-10)\n"))
books = int(input("How many coding books have you read? Guess!\nType a number (0-999)\n"))
fun = int(input("How much fun is coding for you?\nType a number (0-10) -- 10 means a lot\n"))
money = int(input("How much do you plan to earn with Python (US-$ per month)?\nType a number (0-100000)\n"))
freelancer = int(input("Do you want to become a Python freelancer?\nType a number (0,1)\n"))
brain = int(input("Do you love productivity tips?\nType a number (0,1)\n"))
job = int(input("Do you want to get a Python job?\nType a number (0,1)\n"))
dataScience = int(input("Do you dream of becoming a data scientist?\nType a number (0,1)\n"))


'''
# hard-coded
experience = 0
books = 1
fun = 5
money = 10000
freelancer = 0
brain = 1
job = 1
dataScience = 1
'''

articles = {"Freelancer": "https://blog.finxter.com/how-to-earn-1000-on-the-side-as-a-python-freelancer-a-step-by-step-tutorial/",
            "Python Crash Course": "https://blog.finxter.com/python-crash-course/",
            "Python Interview": "https://blog.finxter.com/python-interview-questions/",
            "AI": "https://blog.finxter.com/artificial-intelligence-machine-learning-deep-learning-and-data-science-whats-the-difference/",
            "Books": "https://blog.finxter.com/free-python-books/",
            "Intelligence": "https://blog.finxter.com/how-to-boost-your-intelligence-10-tips-from-science/",
            "Webinar": "https://blog.finxter.com/webinar-freelancer/",
            "Dictionary": "https://blog.finxter.com/python-dictionary/",
            "OneLiner": "https://blog.finxter.com/10-python-one-liners/",
            }

scores = {key:0 for key in articles}

def update(key, prob):
    scores[key] += prob / 6
    

# experience
update("Freelancer", 100)
update("Python Crash Course", 100 - 10 * experience)
update("Python Interview", 10 * experience)
update("AI", 70 if experience >= 3 else 100)
update("Books", 100)
update("Intelligence", 100)
update("Webinar", 100)
update("Dictionary", 50 if experience >= 3 else 100)
update("OneLiner", 10 * experience)

# projects (ignore)

# books
update("Freelancer", 100)
update("Python Crash Course", 100)
update("Python Interview", 100)
update("AI", 100)
update("Books", 100 if books > 2 else 30)
update("Intelligence", 100)
update("Webinar", 100)
update("Dictionary", 100)
update("OneLiner", 100)

# fun (ignore)

# money
update("Freelancer", 100 if money > 500 else 0)
update("Python Crash Course", 100)
update("Python Interview", 100 if money > 500 else 0)
update("AI", 100)
update("Books", 100)
update("Intelligence", 100)
update("Webinar", 100 if money > 500 else 0)
update("Dictionary", 100)
update("OneLiner", 100)

# freelancer
update("Freelancer", 100 if freelancer==1 else 0)
update("Python Crash Course", 100)
update("Python Interview", 100)
update("AI", 100)
update("Books", 100)
update("Intelligence", 100)
update("Webinar", 100 if freelancer==1 else 0)
update("Dictionary", 100)
update("OneLiner", 100)

# job
update("Freelancer", 100)
update("Python Crash Course", 100)
update("Python Interview", 100 if job==1 else 0)
update("AI", 100)
update("Books", 100)
update("Intelligence", 100)
update("Webinar", 100)
update("Dictionary", 100)
update("OneLiner", 100)

# data science
update("Freelancer", 100)
update("Python Crash Course", 100)
update("Python Interview", 100)
update("AI", 100 if dataScience==1 else 0)
update("Books", 100)
update("Intelligence", 100)
update("Webinar", 100)
update("Dictionary", 100)
update("OneLiner", 100)


##
# EVALUATE RESULT
##
recommendations = list(scores.items())
recommendations = sorted(recommendations, key=lambda x: x[1])[::-1]

print()
print("Top Recommended Articles: ")
tmp_dic = {}
i = 0
for k, v in recommendations:
    output = " " if v != 100 else ""
    output += str(round(v)) + "%\t" + "[" + str(i) + "]" + str(k)
    print(output)
    tmp_dic[i] = articles[k]
    i = i + 1

while True:
    read_number = input("Type article number to open: (0-9) ")
    webbrowser.open(tmp_dic[int(read_number)])
    print(tmp_dic[int(read_number)])

You can also copy&paste the Python script into your own code file and execute it on your computer. 😊

The code file will open the articles directly in your browser. Unfortunately, this is not possible in the browser-based shell above.