Python pr
Program 1
# --------------------- 1. Print numbers 1 to 10 ---------------------
Input ---
Output
Q2 # --------------------- 2. Sum of first N numbers (while loop) ---------------------
Input
Output
Q3 --------------------- 3. Reverse a string ---------------------
Input
Output
Q4 # --------------------- 4. Count vowels in a string ---------------------
Input
Output
Q5 --------------------- 5. Largest number in a list ---------------------
Input
Output
Q6 # --------------------- 6. Smallest number in a list ---------------------
Input
Output
Q7 # --------------------- 7. Check if number is prime ---------------------
Input
Output
Q8 # --------------------- 8. Factorial of a number ---------------------
Input
Output
Q9# --------------------- 9. Fibonacci series (first 10 terms) ---------------------
Input
Output
Q10 # --------------------- Sum of list elements ---------------------
Input
Output
Q11 # --------------------- Palindrome check ---------------------
Input
Output
Q12 # --------------------- Remove duplicates from list ---------------------
Input
Output
Q13 # --------------------- Multiplication table ---------------------
Input
Output
Q14 # --------------------- 15. Even numbers in list ---------------------
Input
Output
Q15 # --------------------- Odd numbers in list ---------------------
Input
Output
Q16 # --------------------- Find sum of digits ---------------------
Input
Output
Q17 # --------------------- Count words in a sentence ---------------------
Input
Output
Q18 --------------------- Print patterns using nested loops ---------------------
Input
Output
Q19 # --------------------- Swap two variables ---------------------
Input :
Output :
Q20 --------------------- 20. Squares of numbers 1 to 10 ---------------------
Input
Output
Q21 --------------------- 21. List comprehension: even squares ---------------------
Input
Output
Q22 # --------------------- 22. Create dictionary of squares ---------------------
Input
Output
Q23 --------------------- 23. Find second largest element ---------------------
Input
Output
Q24# --------------------- Check if number is even or odd by user input ---------------------
Input
Output
Q25 # --------------------- 25. Print factorial using while loop ---------------------
Input
Output
Q26 # --------------------- 26. Reverse a list ---------------------
Input
Output
Q27 # --------------------- 27. Check if a year is leap year ---------------------
Input
Output