Just a generation x vegan feminist who is happily married ever after. (she/her) #100Days
1495 words
@Luus

Day 4 - Python bootcamp #100DaysOfCode

Today was all about randomisation and Lists. At the end I had to build
the Rock Paper Scissors game. I added Lizzard and Spock too ;)

The rules are:

• Scissors wins from Paper and Lizard
• Paper wins from Rock and Spock
• Lizard wins from Spock and paper
• Spock wins from Scissors and Rock
• Rock wins from Scissors and Lizard
``````import random

user_input = int(
input(
"What do you choose? Type 0 for Rock, 1 for Paper,2 for Scissors, 3 for Lizard or 4 for Spock.\n"
))
computer_input = random.randint(0, 4)
rock = '''
_______
---'   ____)
(_____)
(_____)
(____)
---.__(___)
'''

paper = '''
_______
---'   ____)____
______)
_______)
_______)
---.__________)
'''

scissors = '''
_______
---'   ____)____
______)
__________)
(____)
---.__(___)
'''
lizzard = '''

_.--._
.'()..()`.
.( `-.__.-' ).
.        /
.      /

'''
spock = '''
_
| |
___ _ __   ___   ___| | __
/ __| '_ . . _ . . __| |/ /
.__ . |_) | (_) | (__|   <
|___/ .__/ .___/ .___|_| _.
| |
._.
'''
images = [rock, paper, scissors, lizzard, spock]

if user_input >= 5 or user_input < 0:
print("That's an invalid option.")
else:
print(images[user_input])
print("Computer chose:")
print(images[computer_input])

if (user_input == 0 and (computer_input == 2 or computer_input == 3)) or (
user_input == 1 and (computer_input == 0 or computer_input == 4)
) or (user_input == 2 and (computer_input == 1 or computer_input == 3)) or (
user_input == 3 and (computer_input == 1 or computer_input == 4)) or (
user_input == 4 and (computer_input == 0 or computer_input == 2)):
print("You win!")
elif user_input == computer_input:
print("It's a draw.")
else:
print("You lose.")
``````

When you run the game, it looks like this:

Makes 12 pancakes.

Ingredients:

• 2½ cups of whole wheat all-purpose flour
• 2 tablespoons of sugar
• 2 teaspoons of baking soda
• ½ teaspoon of salt
• 2 cups of soy milk (or other non-dairy milk)
• 1 ripe banana, mashed
• vegetable oil to oil the skillet
• maple syrup to serve

Directions:

1. In a medium bowl, add the flour, sugar, baking powder, and salt, and stir to combine.
2. Make a crater in the middle of the flour mix, add soy milk and the mashed banana, and whisk until smooth.
3. Let the batter rest for 5 minutes.
4. Lightly coat a skillet with oil and heat over medium-high heat.
5. Pour about ⅓ cup of batter onto the skillet.
6. When the top begins to bubble, flip the pancake and cook the other side until golden (1 a 2 minutes).
7. Repeat with the remaining batter.
8. Serve warm with maple syrup.

Weekends doesn't mean much for me since being jobless. But... to stay synchronized with my husband's schedule, I've decided to only do the Python bootcamp on weekdays.

I had a hard time today about the fact of not having a job. I've searched the web for some quotes to bring me some happiness, but instead of a happy one I stumbled across this quote from Aung San Suu Kyi:

Jobless people will have no self-confidence. And they feel they are worthless because when you don't have a job you have to rely on someone.

It's exactly how I feel right now :(

A little backstory on being jobless (since 2012). I got a burnout, got depressed, looked for help, tried the freelance road, did not work. Got very frustrated and depressed again. I looked for help again, this time at a psychiatrist. Got diagnosed with Autism Spectrum Disorder at age 48. Everything made sense, but... you're born with Autism, there is no getting better. So I felt (still do sometimes, like today) there is no hope in getting a job. It's not only my Autism what makes getting a job difficult but also my age. I turned 50 this year.

Another thing is that I felt like my brain-cells where starving. That's the reason I decided to do this #100DaysOfCode Python bootcamp. To keep me busy, to keep my brain busy, to learn something instead of playing computer-games and watching Netflix.

I have noticed that it helps. But today it's weekend. Today there is no bootcamp to keep me busy. For the first time in my life I gonna be happy when Monday arrives :)

Day 3 - Python bootcamp #100DaysOfCode

This day was all about Control Flow and Logical Operators. It was a long day but I managed to do all the assignments.

Today's end project was to build a little text based game named Treasure Island.

``````print("Welcome to Treasure Island.")
print("Your mission is to find the treasure.")

left_right = input('You are at a cross road. Where do you want to go?
Type "left" or "right". ').lower()

if left_right == "left":
wait_swim = input('You have come to a lake. There is an island in the middle of the lake.
Type "wait" to wait for a boat. Type "swim" to swim across. ').lower()
if wait_swim == "wait":
which_door = input('You arrive at the island unharmed. There is a house with 3 doors.
One red, one yellow and one blue. Which colour do you choose? ').lower()
if which_door == "red":
print("You are burned by fire. Game Over!")
elif which_door == "blue":
print("You are eaten by a beast. Game Over!")
elif which_door == "yellow":
print("Yay! You win!")
else:
print("Game Over.")
else:
print("You are attacked by piranhas. Game Over!")
else:
print("You fall into a hole. Game Over!")
``````

When executed this game looks like this:

Welcome to Treasure Island.
Your mission is to find the treasure.
You are at a cross road. Where do you want to go? Type "left" or "right". Left
You have come to a lake. There is an island in the middle of the lake. Type "wait" to wait for a boat. Type "swim" to swim across. Wait
You arrive at the island unharmed. There is a house with 3 doors. One red, one yellow and one blue. Which colour do you choose? Blue
You are eaten by a beast. Game Over!

Day 2 - Python bootcamp #100DaysOfCode

I have learned about Data Types, Type errors, Type conversion and mathematical operations in Python.
The end project was to build a Tip Calculator.

``````print("Welcome to the tip calculator.")

total = float(input("What was the total bill? \$") )
percentage = int(input("What percentage tip would you like to give? 10, 12 or 15? ") )
people = int(input("How many people to split the bill? ") )
amount_per_person = (total / people) * (percentage/100 +1)

print(f"Each person should pay: \${amount_per_person:.2f}")
``````

The program looks like this:

Welcome to the tip calculator.
What was the total bill? \$150.00
What percentage tip would you like to give? 10, 12 or 15? 12
How many people to split the bill? 5
Each person should pay: \$33.60

Day 1 - Python bootcamp #100DaysOfCode

Today was the first day of the Python bootcamp.

I have learned to work with variables, string manipulation, user input and finished programming a Band Name Generator ;)

``````#1. Create a greeting for your program.
greeting = "Welcome to the Band Name Generator."
print(greeting)

#2. Ask the user for the city that they grew up in.
user_input_city = input("Which city did you grow up in?\n")

#3. Ask the user for the name of a pet.
user_input_pet = input("What is the name of your pet?\n")

#4. Combine the name of their city and pet and show them their band name.
print("Your Band Name could be: " + user_input_city + " " + user_input_pet)
``````

When executed, it looks like this:

Welcome to the Band Name Generator.
Which city did you grow up in?
Stormwind
What is the name of your pet?
Pepe
Your Band Name could be: Stormwind Pepe

The Python programming course I am following is:
100 Days of Code - The Complete Python Pro Bootcamp

Today I decided to accept two challenges: #100DaysOfCode and #100Days of writing. Why not combining these two? So I did.

For 100 Days I will learn how to code in Python and will blog my progress over here.

I decided to write in English, because I suck at it and want to become better.

Let's start this journey!

I am still to much in my own bubble, it's time to come out of it.

I am just testing how this works ;) I like minimalism and I was wondering if the listed.to platform could be a good replacement for my self-hosted blog.

Also not sure yet if I continue in English or perhaps switch to Dutch.

xoxo Luus