Skip to content

maahi3793/MyPythonLearnings

Repository files navigation

hello

Programs to practise

Sure! Here are 50 basic but logically challenging Python programs to practice for entry-level learners:

  1. Hello World: Write a program to print "Hello, World!". done

  2. Odd or Even: Write a program that asks the user for a number and prints whether it is odd or even. done

  3. Leap Year: Write a program to check if a year is a leap year or not. done

  4. Prime Number: Write a program to check if a number is prime or not. done

  5. Factorial: Write a program to compute the factorial of a number. done

  6. Fibonacci Sequence: Write a program to print the first n numbers of the Fibonacci sequence. done

  7. Sum of Digits: Write a program to find the sum of the digits of a number. done

  8. Reverse a String: Write a program to reverse a string.

  9. Palindrome: Write a program to check if a string is a palindrome.

  10. Count Vowels: Write a program to count the number of vowels in a string.

  11. String Length: Write a program to find the length of a string without using the len() function.

  12. Largest Element in a List: Write a program to find the largest element in a list.

  13. Sum of List: Write a program to find the sum of all elements in a list.

  14. List Average: Write a program to find the average of all elements in a list.

  15. Count Elements in List: Write a program to count the occurrences of each element in a list.

  16. Remove Duplicates from List: Write a program to remove duplicates from a list.

  17. Check Sorted List: Write a program to check if a list is sorted in ascending order.

  18. Second Largest Element in List: Write a program to find the second largest element in a list.

  19. Merge Two Lists: Write a program to merge two lists into one.

  20. Find Common Elements in Lists: Write a program to find common elements in two lists.

  21. Matrix Addition: Write a program to add two matrices.

  22. Transpose Matrix: Write a program to find the transpose of a matrix.

  23. Matrix Multiplication: Write a program to multiply two matrices.

  24. Find GCD: Write a program to find the greatest common divisor (GCD) of two numbers.

  25. Find LCM: Write a program to find the least common multiple (LCM) of two numbers.

  26. Binary to Decimal: Write a program to convert a binary number to a decimal number.

  27. Decimal to Binary: Write a program to convert a decimal number to a binary number.

  28. Calculate Simple Interest: Write a program to calculate simple interest.

  29. Calculate Compound Interest: Write a program to calculate compound interest.

  30. Quadratic Equation: Write a program to solve a quadratic equation.

  31. Armstrong Number: Write a program to check if a number is an Armstrong number.

  32. Perfect Number: Write a program to check if a number is a perfect number.

  33. Sum of Series: Write a program to compute the sum of the series 1 + 1/2 + 1/3 + ... + 1/n.

  34. Exponentiation: Write a program to compute the power of a number using a loop.

  35. Check Substring: Write a program to check if one string is a substring of another.

  36. Sort List: Write a program to sort a list of numbers in ascending order.

  37. Find Intersection of Lists: Write a program to find the intersection of two lists.

  38. Check Anagram: Write a program to check if two strings are anagrams of each other.

  39. Binary Search: Write a program to implement binary search.

  40. Linear Search: Write a program to implement linear search.

  41. Caesar Cipher: Write a program to implement a Caesar cipher.

  42. Word Frequency: Write a program to count the frequency of each word in a string.

  43. Find Duplicates in List: Write a program to find all duplicate elements in a list.

  44. Flatten List: Write a program to flatten a nested list.

  45. Check Armstrong Numbers in Range: Write a program to find all Armstrong numbers in a given range.

  46. Check Prime Numbers in Range: Write a program to find all prime numbers in a given range.

  47. Generate Pascal's Triangle: Write a program to generate Pascal's triangle up to n rows.

  48. Longest Common Subsequence: Write a program to find the longest common subsequence of two strings.

  49. Implement Queue using List: Write a program to implement a queue using a list.

  50. Implement Stack using List: Write a program to implement a stack using a list.

These programs will help you understand fundamental programming concepts and improve your problem-solving skills. Happy coding!

Programs list to practice Strings and print functions day 1 or lecture

Sure! Here are 10 practice programs for you to work on:

Practice Programs

  1. User Information

    • Ask the user for their name, age, and favorite color. Display a message that includes all this information.
  2. Full Name Separator

    • Take the user's full name and separate it into first and last name. If the user enters more than two names, consider only the first and last names.
  3. Reverse Name

    • Take the user's full name and print it in reverse order (last name first).
  4. Sentence Capitalizer

    • Take a sentence from the user and return it with each word capitalized.
  5. Personalized Greeting

    • Ask the user for their first name, last name, and hometown, and print a personalized greeting.
  6. Email Formatter

    • Ask the user for their first name and last name, and then generate an email address in the format firstname.lastname@example.com.
  7. Initials Extractor

    • Take the user's full name and extract the initials.
  8. Name Length Checker

    • Ask the user for their full name and display the number of characters in the full name (excluding spaces).
  9. Username Generator

    • Generate a username for the user by asking for their first name, last name, and a random number, and then combining these elements.
  10. Phone Number Formatter

    • Ask the user for a 10-digit phone number and format it as (XXX) XXX-XXXX.

About

Will try to finish learning python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages