Python-language-question

Level: Beginner

1. Write a Python program to print "Hello, World!".
2. Write a Python program to add two numbers.
3. Write a Python program to find the square root of a number.
4. Write a Python program to calculate the area of a triangle.
5. Write a Python program to swap two variables.
6. Write a Python program to generate a random number.
7. Write a Python program to check if a number is positive, negative, or zero.
8. Write a Python program to check if a number is odd or even.
9. Write a Python program to find the factorial of a number.
10. Write a Python program to check if a year is a leap year.
11. Write a Python program to find the largest of three numbers.
12. Write a Python program to find the sum of natural numbers.
13. Write a Python program to find the ASCII value of a character.
14. Write a Python program to compute the power of a number.
15. Write a Python program to print all prime numbers in an interval.
16. Write a Python program to find the sum of digits in a number.
17. Write a Python program to reverse a string.
18. Write a Python program to check if a string is a palindrome.
19. Write a Python program to convert kilometers to miles.
20. Write a Python program to convert Celsius to Fahrenheit.
21. Write a Python program to check if a number is a prime number.
22. Write a Python program to find the GCD of two numbers.
23. Write a Python program to find the LCM of two numbers.
24. Write a Python program to count the number of vowels in a string.
25. Write a Python program to remove punctuation from a string.
26. Write a Python program to sort words in alphabetical order.
27. Write a Python program to calculate the length of a string.
28. Write a Python program to count the occurrences of a substring in a string.
29. Write a Python program to check if a string is a valid email address.
30. Write a Python program to check if a number is an Armstrong number.
31. Write a Python program to find the Fibonacci series up to a given number.
32. Write a Python program to find the median of three numbers.
33. Write a Python program to check if a string contains only digits.
34. Write a Python program to convert a decimal number to binary.
35. Write a Python program to convert a decimal number to octal.
36. Write a Python program to convert a decimal number to hexadecimal.
37. Write a Python program to find the HCF of two numbers.
38. Write a Python program to find the LCM of two numbers.
39. Write a Python program to print the multiplication table of a given number.
40. Write a Python program to find the sum of squares of the first n natural numbers.
41. Write a Python program to find the cube root of a number.
42. Write a Python program to check if a string is a valid identifier.
43. Write a Python program to find the sum of the series 1+1/2+1/3+...+1/n.
44. Write a Python program to check if a number is a perfect number.
45. Write a Python program to calculate the simple interest.
46. Write a Python program to calculate the compound interest.
47. Write a Python program to find the sum of all numbers in a list.
48. Write a Python program to find the largest number in a list.
49. Write a Python program to find the smallest number in a list.
50. Write a Python program to print all even numbers in a list.

Intermediate Level: View

Advanced Level: View