Skip to main content

Posts

Showing posts from June, 2026

365 DAYS OF CODE - DAY 10

I realized that I have been tagging each day in accordance with the 100 days of python course . Now, I am one day behind (it is day 10 of the 365 days of code but day 9 on the python course I am taking right now) because I made sure to review unclear exercises yesterday. It is fine regardless. On day 9 of the python course, we looked at dictionaries, its table-likeness (2 columned) One tiny forgotten comma leads to 4 different errors and 1 warning, the prominent one being the SyntaxError. But shouldn’t it highlight line 3 instead of line 4?? Comma added, Error fixed. My Grading Program Code: student_scores = {     'Harry': 88,     'Ron': 78,     'Hermione': 95,     'Draco': 75,     'Neville': 60 }   student_grades = {}   for key in student_scores:     if student_scores[key] > 90:         student_scores[key] = "O...

365 DAYS OF CODE - DAY 9

I decided to review days 7 and 8 since I had problem understanding the exercises (i.e., Hangman and Caesar Cipher). Ability wins over Speed in the long run I believe. It feels like a break but not really a break. But I do feel refreshed kinda. Yayy

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 We...

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 6

THOUGHT PROCESS Today we covered defining and calling functions, Reeborg’s World , indentation (i.e., tabs or 4 spaces), I might watch Silicon Valley, I prefer tabs over spaces because you just have to do it once. We also covered the while loop (and compared it to the for loop), the infinite loop (print out your condition if you do not know why you are getting an infinite loop.), Reeborg Hurdle 1 Loop Challenge: My Code: def turn_right():     turn_left()     turn_left()     turn_left()     def jump():     turn_left()     move()     turn_right()     move()     turn_right()     move()     turn_left()     def move_and_jump():     move()     jump()   for reeborg in range(6):     move_and_jump()   # I am actual...

365 DAYS OF CODE - DAY 5

DAY 5 THOUGHT PROCESS I had a cybersecurity class today and today’s project inspiration is from hacking which is quite interesting. Creating a password generator sounds cool. I also like that today has just 6 videos :) We learned about the concept of loop, for loop and lists. I noticed PyCharm’s loading page today and thought “We can do this with python?” Interesting. I would have loved to paste a picture of it here but I could not screenshot it. I also tried finding it online but could not. We learned about the sum function, an else statement is not always necessary, for loop and the range function. Today, I decided not to ask for help at all, and I managed to complete all exercises myself. I still used “/” instead of “%” today but later corrected it. I am doing a great job. Yayy

365 DAYS OF CODE - DAY 4

DAY 4 THOUGHT PROCESS We learned randomization, modules, generating random integers and floating point numbers (always less than 1 but positive) using the random.random() function. For the code to print heads or tails exercise, I only saw head once although I was not really concentrating on the screen. I tried running till I got another but gave up eventually. My code: import random random_number = random.randint( 1 , 10 ) if random_number/ 2 == 1 :     print ( "Heads" ) else :     print ( "Tails" ) Correct code: import random random_number = random.randint( 1 , 10 ) if random_number% 2 == 1 :     print ( "Heads" ) else :     print ( "Tails" ) We learned Lists data structure; a way of organizing and storing data, the index out of range error (i.e., IndexError), nested lists, did a lot of struggling and asked a friend for help. Final code: import random rock = '''     _______ ---'...

365 DAYS OF CODE - DAY 3

DAY 3 THOUGHT PROCESS Conditional statement; if/else, draw.io is great for drawing flowcharts, spacing and indentation are very important, comparison operators (i.e., < , > , < = , > = , = = , ! = ), modulo operator (i.e., %) gives the remainder of a division, nested if/else, if/elif/else, we can use as many elif as we can in between the if-else statement. I was not very confident about the bmi calculator but I got it right although our approaches were different. I guess coding really builds up our logic. We also learned multiple if statements in succession, indentation has to be a multiple of 4, logical operators, get ascii art at ascii.co.uk/art/treasure (hearing it for the first time), using 3 single quotes at the beginning and end of a multi block string, the “\” is used as an escape symbol in Python, lower function (.lower()), I did all the coding exercises today except the Treasure Island Game (Maybe I will look into it someday, Maybe). I failed to read the de...

365 DAYS OF CODE - DAY 2

DAY 2 THOUGHT PROCESS Her voice is so amazing :) The len function can’t be used on an int data type. I did not know this. We learned about subscripting, integers, that underscores are used instead of commas for large numbers (i.e., 123_456_789 instead of 123,456,789), floats, Boolean. The quizzes are interesting. We learned how to check what data type a given data is (i.e., type checking), type casting, understand type error, mathematical operations, implicit type casting for the “/” division operator, PEMDASLR, the round function (you can also decide how many decimal places you want), number manipulation (manipulating a value based on its previous value using =+, -=, *= and /=), f strings to combine different data types at once. I am a computer sometimes and in the top 50% :) Yayy