Volta's Python Projects
This page has links to download some of the python projects that I've written
I'm still a super beginner, but I want this page to serve as an archive of my learning progress. Hopefully the programs get better and more useful over time!
- Odd or Even - July 10, 2024 - This program prompts the user for a number, then outputs whether the number is odd or even. Finally, it prints a statment concluding the program
- Square Root - July 9, 2024 - This program prompts the user for a number, and a decimal point accuracy. It uses a bisectional search method to guess and check for the positive squarer root of that number. It uses the
sleep
function from thetime
library to make it look like the program is taking some time to think. It outputs each successive guess, then a final guess rounded to the decimal point accuracy that the user specified. - Cubed Root - July 9, 2024 - Similar to the Square Root program, asks the user for a number and decimal point accuracy. Finds the cubed root of any real number. This program skips the funny
sleep
stuff. - Name List - July 24, 2024 - This program initiates an empty list. It then prompts the user to enter a name, asking after each name if the user wants to enter another. When the user is done entering names, the program asks the user for a number between 1 and N where N is the number of elements in the list. It then prints the element at position user entry -1.
- See the World - August 4, 2024 - Problem 3-8 from Eric Matthes' Python Crash Course 3rd Ed. Asks the user how many places they want to go, prompts the user to enter those locations and saves the responses to a list, does some transformation to the list, and prints the results.
- Borrowed a function for creating ordinals
- Coded a while loop for checking that user input is a positive integer
- Learned the difference between functions and methods
- See the World Remix - August 6, 2024 - Taking my program from exercise 3-8, I did a little more messing around with the list generated by the user input
- Learned a bit about proper style as it relates to PEP8
- Learned the "key=" argument for the sorted() function and .sort() method
- List comprehensions include the for loop on a single line for generating a list
- Dictionaries - August 7, 2024 - This one prompts the user for people's names, asks some information about them, stores the data in dictionaries, then reads the data back out in complete sentences.
- This one reuses the ordinal function and positive integer check from earlier
- Uses
for
loops to iterate through the names and add entries to the dictionaries - It can be difficult to decide how you want to slice the data and store it, because dictionaries are 2-dimensional. Do you have a dictionary for each person, then store each data piece as a key in the personal dictionary? Or do you make each data piece a separate dictionary and have the persons name as the key? I went with the ladder on this one, but it could be done either way