Skip to content

selennazlib/CodeInPython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Projects

It's a challenge that aims to gain code practice and enhance programming knowledge.

Day #1 Create a Band Name Generator

It's actually a pretty basic exercise to understand string manipulation and input function. You have two inputs which contain city and pet name , and to create a band name , you have to put two of them together.

Day #2 Tip Calculator

This project is mostly about mathematical operators. It’s a useful project to calculate the bill per person if you’re bad at math :) . In addition to the bill , there’s a tip which you must add to the bill to calculate the total amount of the bill. Then, you can calculate the bill per person by dividing the total amount of bill by the person to split.

Day #3 Treasure Island

This is a fun game to play . You have to find treasure to win the game, but it's not easy. You must be careful because there are lots of traps. It helps us to understand ,that the basis of if/else statements. Also I added a island view that called ASCII ART . For more ASCII ART you can visit :

Day #4 Rock Paper Scissors

This classic “rock paper scissors” game is all about the if/else conditions in this program. You’re playing against the computer :) It’s kinda exciting !!! For better UI, I added ascii arts that represent rock, paper ,and scissors.

Day #5 Password Generator

The Password Generator project contains two levels : easy ,and hard. We retrieve 3 inputs called hm_letters , hm_numbers ,and hm_symbols that decide how many numbers of them(letter,number,symbol) that the user wants in their passwords. Ex: 3 letters, 4 numbers ,and 1 symbol. With these values, you have to create a password considering the inputs “respectively” . Ex: sel2626@ . It’s the easy level ,but the hard level aims to randomise the order of characters. Ex: (assume the number of inputs are the same) s26@e6l2

Day #6 The Hangman Game

In this project I created 3 files: hangman_stages (for stages of hangman ), main, wordlist (for alphabet). I could use all of them in one file but separated them into 3 because it's more readable. I used if conditions to control lives and printed the stages that represent the lives . Lastly, I checked if there is a ‘_’ symbol . If there is, that means the user couldn’t finish the game ,but if there is not, that means the user predicted all letters in the word before the man hung :)))

Day #7 CaesarCipher

In cryptography, a Caesar cipher, also known as Caesar's cipher, the shift cipher, Caesar's code or Caesar shift, is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, with a left shift of 3, D would be replaced by A, E would become B, and so on. The method is named after Julius Caesar, who used it in his private correspondence. For more information about Caesar cipher: https://en.wikipedia.org/wiki/Caesar_cipher

This project’s main aim is to encode and decode messages. Also , with the while loop you can encode or decode messages as much as you wish :)))

Ps: I added the alphabet into the alphabet list twice because of the “out of range” error.

Day #8 The Secret Auction Program

This program aims to find the highest value in the dictionary called ‘d’ :). In the dictionary you’re matching names with bid amounts. For example {“selen”: 789, “nazlı”: 564} , then you have to find who has the highest bid . I casted dictionary to the list to use the “max” function :) Then with the max value’s index I got the winner's name.

Day #9 Calculator

I defined a functions to each transaction and match them with the operator symbols (‘+’ ,‘-’,’ /’ ,‘*’ ). I got two inputs from the user and asked for the transaction that the user wanted(I did that in a while loop so the user didn't need to end the program to calculate a new transaction) . In the end all of these I printed the result : print(f"{result} {operation_symbol} {next_num} = {next_result}") Example result = 12 + 5 =17 Also , you can use the previous answer: 12 + 5 = 17 (choose to continue)17 - 7 = 10 …

Day #10 The BlackJack Project

Blackjack is a "Casino game" . Also known as "Twenty-One (card game)". Rules of the blackjack (for more information about this card game click here.):

  • The goal of blackjack is to beat the dealer's hand without going over 21.
  • Face cards are worth 10. Aces are worth 1 or 11, whichever makes a better hand.
  • Each player starts with two cards, one of the dealer's cards is hidden until the end.
  • To 'Hit' is to ask for another card. To 'Stand' is to hold your total and end your turn.
  • If you go over 21 you bust, and the dealer wins regardless of the dealer's hand.
  • If you are dealt 21 from the start (Ace & 10), you got a blackjack.
  • Blackjack usually means you win 1.5 the amount of your bet. Depends on the casino.
  • Dealer will hit until his/her cards total 17 or higher.

Day #11 The Number Guessing Game

In this project there are two levels: hard and easy. Actually these levels are about numbers of guessing. In the hard level you have 5 chances to guess but easy level provides you 10 chances to guess.

Logic of the game is: Computer chooses a random number from 0 to 100. Then the user makes her/his first guess if it is higher than the chosen number, the computer prints "Too high” ,vice versa.

Meantime computer also prints the remaining lives. When the user guesses the correct to chosen number before finishing her/his lives, the user wins .

Day #12 Debugging Exercises

Debugging Tips:

  • Describe the problem
  • Reproduce the bug
  • Play computer
  • Fix the errors
  • "Print" is your friend
  • Use a debugger
  • Take a break
  • Ask a friend
  • Run often
  • Ask StackOverflow

EVERYONE GETS BUGS 🐞 :)

Day #13 Coffee Machine

This project is the first one which I use OOP. There are many different techniques related to OOP.

Simply I tried to create a coffee machine which controls the remaining ingredients, total payment, are all of the ingredients enough to make coffee , change of money.

About

This is a repository for "100 days of code challenge" projects. You can reach all projects from beginner to professional which are written in Python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages