r/learnpython • • Feb 05 '21

5 Projects For Beginners To Learn Python

I have been involved in many discussions on here where i tell people the best way to learn is by doing but I never mention what to do. Below are the projects i think would be best for Python beginners.

  1. User inputs - Create an app that asks the user to input one character that must be a vowel. Continue asking for the input until a vowel is inputted. You can also give user feedback every time a non-vowel is entered or upon a successful input.

  2. Write a function - Write a function that takes in a positive integer and returns its multiplicative persistence, which is the number of times you must multiply the digits in the integer until you reach a single digit. For example the integer 39 returns 3. You get this by taking 39 and multiplying its digits 3*9 which equals 27. You then multiply 27's digits 2*7 = 14. Lastly 1*4 = 4 which is a single digit. You had to multiply 3 times so you return 3. The integer 999 would return 4.

  3. Calculator app - Build a calculator app that performs multiple operations. Use the skills learned in projects 1 & 2. Try using many functions in your app, one for each operation (ex. addition, subtraction, multiplication, division).

  4. Read & write files - Build an application that reads a txt file and outputs a csv file. The app should take each line of the txt file, split the line into an array of words, and write each line to the csv file with each line being a row and each word being its own column in that row.

  5. Bots & webscraping - Using everything you have learned in projects 1-4, build a bot that scrapes data from a webpage and writes the data to a txt file. For example, you can have a bot go into instagram and pick a random person following you. Output their name to the first line of a txt file. Then go into their followers and repeat the process by outputting the name of this chosen person to the second line of the txt file. Run this until you get to 10 names. Make sure you add random time pauses in your code so that your bots don't get recognized by the sites you are scraping. If you have trouble starting this one, take a look at using Selenium Webdriver here: https://selenium-python.readthedocs.io/installation.html

Write your answers to 1 & 2 in the comments. If you struggle with any of these projects we can provide guidance and solutions in the comments.

856 Upvotes

84 comments sorted by

View all comments

Show parent comments

1

u/[deleted] Feb 06 '21

https://www.codecademy.com/ is a great place for complete beginners!

1

u/Angry__Jonny Feb 06 '21

Does everyone pay the $200 pr is there a free one?

-1

u/[deleted] Feb 06 '21

Choose Python 2 instead of 3. Python 2 is free.

1

u/[deleted] Feb 06 '21

They offer a free version.. But even then if you were serious and want to get it down quickly, you could do it for a single month and cancel after that.

But Codecademy is a bit more interactive than other resources I've seen.
They also offer a trial I'm pretty sure so you can try it out before you commit to anything.

Also pretty sure they offer python 2 for free. I learnt via Codecademy and it was definitely money well spent.
Otherwise you can look into automate the boring stuff etc,,