Sunday, 19 March 2023

Here are 50 common Python interview programs:

python interview questions

In this post, we have given the interview questions at the very beginner level.


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

  2. Write a program to swap two variables.

  3. Write a program to find the largest number among three numbers.

  4. Write a program to check whether a number is even or odd.

  5. Write a program to find the sum of natural numbers up to a given number.

  6. Write a program to find the factorial of a number.

  7. Write a program to check whether a given string is a palindrome or not.

  8. Write a program to count the number of vowels in a given string.

  9. Write a program to reverse a string.

  10. Write a program to check whether a given number is a prime number or not.

  11. Write a program to find the Fibonacci series up to a given number.

  12. Write a program to find the GCD of two numbers.

  13. Write a program to find the LCM of two numbers.

  14. Write a program to convert Celsius to Fahrenheit.

  15. Write a program to convert Fahrenheit to Celsius.

  16. Write a program to find the roots of a quadratic equation.

  17. Write a program to find the area of a circle.

  18. Write a program to find the area of a triangle.

  19. Write a program to find the perimeter of a rectangle.

  20. Write a program to find the perimeter of a square.

  21. Write a program to find the area of a rectangle.

  22. Write a program to find the area of a square.

  23. Write a program to find the sum of digits of a given number.

  24. Write a program to find the number of digits in a given number.

  25. Write a program to check whether a given number is a palindrome or not.

  26. Write a program to find the ASCII value of a character.

  27. Write a program to find the HCF of two numbers.

  28. Write a program to find the sum of the digits of a given number until the sum becomes a single digit.

  29. Write a program to find the sum of even and odd numbers in a given list.

  30. Write a program to find the maximum and minimum elements in a given list.

  31. Write a program to remove duplicates from a given list.

  32. Write a program to sort a given list in ascending and descending order.

  33. Write a program to find the second largest element in a given list.

  34. Write a program to find the second smallest element in a given list.

  35. Write a program to reverse a given list.

  36. Write a program to find the sum of all numbers in a given list.

  37. Write a program to find the average of all numbers in a given list.

  38. Write a program to find the median of all numbers in a given list.

  39. Write a program to find the mode of all numbers in a given list.

  40. Write a program to find the frequency of each element in a given list.

  41. Write a program to find the common elements between two given lists.

  42. Write a program to merge two given lists and remove duplicates.

  43. Write a program to count the number of occurrences of a given element in a given list.

  44. Write a program to find the intersection of two given lists.

  45. Write a program to find the union of two given lists.

  46. Write a program to find the difference between two given lists.

  47. Write a program to remove the nth element from a given list.

  48. Write a program to find the sum of elements in the diagonal of a matrix.

  49. Write a program to find the transpose of a matrix.

  50. Write a program to multiply two matrices.

 

No comments :

Post a Comment