This repository is a personal learning space where I upload small Python programs to recall, revise, and strengthen my understanding of core Python concepts.
- Used
randomto generate a number - Took user input and compared values
- Practiced basic
if/elseconditions
- Checked password length
- Looked for at least one uppercase letter and one number
- Used a loop and simple boolean variables
- Took two numbers and an operator as input
- Used basic arithmetic operations
- Used
if/elifto choose the operation
- Sorted characters of a string
- Generated combinations of different lengths
- Used the
itertoolsmodule
- Read input scores and stored them in a list
- Removed duplicate values using a set
- Sorted the unique scores to find the ranking
- Printed the second highest score as the runner-up
- Created a program to check whether a number is a Perfect Number
- Found all factors of the number except the number itself
- Calculated the sum of those factors
- Compared the sum with the original number to determine the result
Personal Experience
- I wrote this program during a coding event where we were introduced to the concept of Perfect Numbers and asked to implement it.
- After understanding the definition, I immediately started thinking about the logic and translated it into code.
- It might seem like a small task, but it felt like a big personal win because I was able to write the solution confidently while many others were still figuring out their code.
- It was one of those moments that made me feel proud of my progress in problem solving.
- Got an integer as an input
- converted them into a list of digits using map()
- Calculated the sum of each digit raised to the power of the total number of digits
- Compared the result with the original number to determine the output
Swap Case
- Wrote a program to swap uppercase letters to lowercase and vice versa
- Used
islower()andisupper()to check character cases - Traversed the string using a loop
- Converted the result list back into a string using
"".join() - There is an inbuilt function, but whats more fun that writing it all by yourself
Lyrics Typewriter
- Created a script that prints song lyrics with delays
- Used
time.sleep()to control timing between lines - Printed characters one by one to create a typewriter effect
- Practiced working with lists of tuples and loops
- To revise Python fundamentals regularly
- To improve problem-solving and logical thinking
- To build a habit of writing code from scratch
- To maintain a personal reference for Python concepts
- To track my learning progress over time