Skip to main content

365 DAYS OF CODE - DAY 8

We covered functions with input, parameter and argument is like variable and value but for functions, the order matters.

Today is day 8 and I do not want to do difficult exercises, I am thinking of taking a break. Do I really have to do this everyday??

My Love Calculator Code:

def calculate_love_score(name1, name2):
    check_name = name1 + name2
    check_name.lower()
    true =
0
   
love = 0
   
for letter in check_name:
       
if letter in "true":
            true +=
1
   
for letter in check_name:
       
if letter in "love":
            love +=
1
   
love_score = str(true) + str(love)
   
print(f"Love Score = {love_score}")

calculate_love_score(
"Kanye West", "Kim Kardashian")

 

Why am I learning to code??

Comments

Popular posts from this blog

365 DAYS OF CODE - DAY 0

DAY 0 THOUGHT PROCESS Day Zero of the 365 days of code highlights my state of mind before the actual start of the program. Yes, it is a program. A program I set for myself to make sure I actually put in the work on a daily. I have tried coding before but have never been quite consistent with it. A friend advised me to try coding daily if I really wanted to be great at it someday. He also stated that it would take a long time and I should be prepared for it. During the same period, I noticed he was on a year's worth streak of chess which made me realize I could also do the same but with coding. I signed up for the 100 days of code course on Udemy and plan on starting my coding journey with Angela Yu and the thousands of students also taking the course. I also drafted my own copy of the pledge, copied and modified from the 100 Days of Python Pledge from the course materials. It is currently pasted on my wall as a constant reminder. Finally, I will also be recording my process here...

365 DAYS OF CODE - DAY 7

I am overwhelmed already. From yesterday, I guess. How I would program hangman: 1.1.       A list of guess words for the game 2.2.       Loop through them 3.3.       Ask the user for an input 4.4.       Get the len of the guess word for every stage 5.5.       Check if letter is in the guess word and what position 6.6.       Number of possible trials 7.7.       E.t.c. From here onward, I was simply struggling to continue. I think it was worth it though. Anyho, Yayy

365 DAYS OF CODE - DAY 1

DAY 1 THOUGHT PROCESS I had to download PyCharm and set it up although I already had vs code on my PC. It was a requirement. I happened to look through the course content yesterday and thought of downloading PyCharm before today but I’m glad I didn’t. I completed the first assignment successfully. We had to print out a 5-line recipe, and I just made use of the print function for each line. I know there’s a shorter way to do this (i.e., printing multiple lines at once) but I couldn’t really remember. I think it’s by using the quotation thrice (i.e., “““xxx”””) but it’s day 1. It’s fine. We’ll learn it in future courses. And then it was covered in the next lesson. Crazy!! It ended up not being what I expected :) Day 1 also covered debugging, string concatenation, the input function, comments (Ctrl + /), the len function and variables. Exercise 1 – print out a recipe Exercise 2 – debug some lines of code Exercise 3 - switch the contents of the 2 glasses with 3 lines of code....