30-Day Coding Challenge

Day 9 — Browsing Old Scripts

Kester R.
DSV Logs!
Published in
2 min readJul 14, 2024

--

Photo by Author Via Microsoft Designer & Canva

As I write this, I feel so tired.

Today has been rough, especially since it’s one of the few days I spent most of my time outdoors.

As such, I couldn’t write much code today. But instead, I browsed through some of my earliest scripts that still exist on my PC.

One that caught my eye is this weight conversion code:


Weight = float(input('Weight: '))

Unit = input('(K)g or (L)bs: ')

if Unit.upper() == 'L':
lbs_to_kg = Weight * 0.45
print('Weight in Kg:', lbs_to_kg)

else:
kg_to_lbs = Weight / 0.45
print('Weight in Lbs:', kg_to_lbs)

I remember watching a YouTube video then where I learned to do something like this. On seeing this, I finally remembered the connection with my Temperature Converter version 1.0

I initially wrote the Temperature Converter code to practice the use of input, if, and else statements.

Then as time passed, I added several improvements, making the Temperature Converter version 1.0 discussed in some of my previous reports (See Day 2 Report to see the code👇).

An exciting rediscovery for me (Just feeling too tired to show it in my expression).

Before I go, here’s the Number Operations code promised yesterday:

Thanks for reading and Till tomorrow…

--

--

Kester R.
DSV Logs!

I'm a writer trying to do what he knows best - "hitting the keys on my keyboard"