Projects developed in order to learn the language basics, exercise coding, learn more about computer science and have fun solving some interesting problems !
What you can find in this repo:
- Unit01_longestAlphOrder
Let s be a string of lowercase characters. This program prints the longest substring of s in which the letters occur in alphabetical order. For example, if s = 'abcabcegpzbaabcdefgh', then the program prints 'aabcdefgh'
- Unit02_numberGuess
You think of an integer between 0 (inclusive) and 100 (not inclusive). The computer makes guesses, and you give it inputs: is its guess too high or too low ? Using bisection search, the computer will guess your secret number
- Unit02_iterationXrecursion
Series of exercises to present the difference, as well as advantages and disadvantages in solving problems with iteration and recursion
- Unit02_debtCalculations
Unit_2_ProblemSet_2_1_debtAfterYear: Calculates the credit card balance after one year if a person only pays the minimum monthly payment (4%) required by the credit card company each month
Unit_2_ProblemSet_2_2_minimumPayOff: Calculates the minimum fixed monthly payment (multiple of $10) needed in order pay off a credit card balance within 12 months
Unit_2_ProblemSet_2_3_bisectionEfficiency: Uses bisection search to make the program more efficient: finds the result faster while being more precise also - accurate to the cent instead of finding a result that is multiple of $10
- Unit03_hangman
Hangman game : You have 8 guesses to find out the word that was randomly loaded from the words.txt file
- Unit03_midTerm_deepReverse
Let L be a list of lists whose elements are ints. This function mutates L such that it reverses its elements and also reverses the order of the int elements in every element of L
- Unit03_midTerm_keyFilter
Function that returns a list of keys in a dictionary with the value target. The list of returned keys should be sorted in increasing order. The keys and values are both integers. If the dictionary does not contain the value target, it should return an empty list
- Unit03_midTerm_lacedStrings
Recursive procedure which laces together two strings. It should not use any explicit loop mechanism, such as a for or while loop
- Unit03_midTerm_polynomeEval
Numerical evaluation of a polynome. Let L be a list of numbers (n0, n1, n2, ... nk). Returns a function, which when applied to a value x, returns the value:
n0 * x^k + n1 * x^(k-1) + ... nk * x^0
- Unit04_wordGame
This game is a lot like Scrabble, if you've played it. Letters are dealt to the user, who then construct one or more words out of them. Each valid word receives a score, based on the length of the word and the letters in that word. The file ending with '_wPC' let's you play with the computer
- Unit05_caesarCipher
The idea of the Caesar Cipher encryption is to pick an integer s and shift every letter of the message by that integer s. Then the decryption process consists on performing a shift of 26-s. The program plays with encryption and decrypts a short encrypted story
- Unit07_finalExam_digitSum
Returns the sum of all of the digits in a given string s. If there are no digits in s it raises a ValueError exception
- Unit07_finalExam_myDict
Implements a dictionary without actually using a dictionary
- Unit07_finalExam_uniqueValues
Given a dictionary, returns a sorted list of keys that map to unique values. Empty list if no values comply with the rule