Skip to content

its-dharani/Python-Practice

Repository files navigation

Python-Practice

This repository is a personal learning space where I upload small Python programs to recall, revise, and strengthen my understanding of core Python concepts.


Daily Practice

Day 1 – Number Guessing Game

  • Used random to generate a number
  • Took user input and compared values
  • Practiced basic if/else conditions

Day 2 – Password Strength Checker

  • Checked password length
  • Looked for at least one uppercase letter and one number
  • Used a loop and simple boolean variables

Day 3 – Simple Calculator

  • Took two numbers and an operator as input
  • Used basic arithmetic operations
  • Used if/elif to choose the operation

Day 4 – String Combinations Program

  • Sorted characters of a string
  • Generated combinations of different lengths
  • Used the itertools module

Day 5 – Runner-Up Score Finder

  • 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

Day 6 – Perfect Number Program

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

Day 7 – Armstrong Number Program

  • 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

Day 8 - Swap Case and Lyrics Typewriter

Swap Case

  • Wrote a program to swap uppercase letters to lowercase and vice versa
  • Used islower() and isupper() 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

🎯 Purpose of this Repository

  • 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

About

Small Python programs to recall and practice core concepts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages