Python Machine Test Questions

Welcome to our Python Machine Test Questions hub, a one-stop destination for sharpening your skills and mastering the intricacies of Python in machine learning interviews. Our carefully curated selection of Python machine test questions is tailored to help you navigate the challenges of technical assessments. Whether you’re a seasoned professional or a budding enthusiast, our collection covers a spectrum of topics to enhance your proficiency. Immerse yourself in our Python machine test interview questions to gain confidence and expertise, ensuring you’re well-prepared for success in your machine learning endeavors.

basic python machine test interview questions

Basic Machine Test Interview Questions on Python

  1. Write a program in Python that adds up all the digits in a number. For example, if the user enters 123, the program should find and display the sum of 1, 2, and 3.
  2. Create a Python program that takes an integer from the user and shows it in reverse order. For instance, if the user inputs 456, the program should display 654.
  3. Make a Python program that shows all the numbers between 10 and 50 which are multiples of 3. For example, it should display numbers like 12, 15, and 18.
  4. Design a Python program that finds and displays all numbers between 100 and 200, where the sum of their digits is an even number. For instance, it should include numbers like 115 (1+1+5=7) but not 120 (1+2+0=3).
  5. Write a Python program to check if a given number is a prime number or not. If the user enters a number, the program should tell whether it’s a prime number (only divisible by 1 and itself) or not.
  6. Create a Python program that finds the largest number in a list of five numbers. Ask the user to input these numbers, and then the program should determine and display which one is the largest.
  7. Create a Python program that removes a number from a list. Ask the user for the index of the number to remove, and then display the list after removal.
  8. Write a program in Python to check if a word is the same when read backward. For instance, if the user inputs “radar,” the program should say it’s a palindrome.
  9. Make a Python program that tells the user if a given year is a leap year or not. Ask the user to input a year, and then the program should display whether it’s a leap year or not.
  10. Create a simple calculator program in Python. Ask the user for two numbers and an operation (+, -, *, /). Then, display the result of the operation.
  11. Write a Python program that calculates the cube of each number from 1 to a given number. For example, if the user enters 3, the program should display the cubes of 1, 2, and 3.
  12. Write a Python program to show the first 10 numbers in the Fibonacci sequence.
  13. Create a program that asks for a number and then displays its multiplication table up to 10.
  14. Make a program that counts and tells the user how many digits are in a given number.
  15. Write a program to find the factorial of a number that the user enters.
  16. Create a program to find how many times a specific word appears in a sentence, considering both uppercase and lowercase versions.
  17. Write a program that takes a series of numbers as a text and calculates the sum and average of those numbers.
  18. Make a program that removes any empty words from a list of words.
  19. Create a python program to display a pattern of stars forming a right-aligned triangle.
  20. Make a python  program to show a pattern of stars forming a left-aligned triangle in Pascal’s pattern.
  21. Write a python program to display a pattern of stars forming a sandglass shape.
  22. Create a program to show a pattern of stars forming a pant style shape.
  23. Make a program to display another pattern of stars forming a diamond shape.
  24. Write a program to create a pyramid pattern using horizontal multiplication tables.
  25. Create a program to display a pattern where each number is doubled.
  26. Make a program to show a pattern of random numbers.
  27. Write a program that counts how many letters, digits, and special characters are in a given sentence or word.
  28. Create a program that asks the user for their age. Depending on their age, calculate and show the ticket price for a movie theatre:
    1. Age 0-5: Free
    2. Age 6-17: Child ticket $50
    3. Age 18-59: Adult ticket $100
    4. Age 60 and above: Senior ticket $75
  29. Write a program that combines two lists into a dictionary. The lists are:
  30. Keys: [‘Ten’, ‘Twenty’, ‘Thirty’]
  31. Values: [10, 20, 30]
  32. Create a program that combines the information from two Python dictionaries into a single dictionary.
  33. Make a program that takes a list and divides it into three equal parts. Then, reverse each of these chunks. The sample list is: [11, 45, 8, 23, 14, 12, 78, 45, 89]
  34. Write a program to display a pattern of stars forming a right-angled triangle pyramid.
  35. Create a program to show a pattern of stars forming a downward half-pyramid.
  36. Create a program to display a pattern of stars forming a full downward pyramid.
  37. Write a program to show a pattern of stars forming a right downward mirror.
  38. Make a program to display a pattern of stars forming an equilateral triangle.
  39. Create a program to print two pyramid patterns of stars.
  40. Write a program to display a pattern of stars forming a right-aligned triangle.
  41. Make a program to show a pattern of stars forming a left-aligned triangle in Pascal’s pattern.
  42. Create a program to display a pattern of stars forming a sandglass shape.
  43. Write a program to show a pattern of stars forming a pant style shape.
  44. Make a program to display a pattern of stars forming a right-angled triangle pyramid.
  45. Create a program to show a pattern of stars forming a downward half-pyramid.
  46. Write a program to display a pattern of stars forming a full downward pyramid.
  47. Make a program to show a pattern of stars forming a right downward mirror.
  48. Create a program to display a pattern of stars forming an equilateral triangle.
  49. Write a program to print two pyramid patterns of stars.
  50. Write a program to display a pyramid pattern using numbers less than 10.
  51. Create a program to show a pyramid pattern using numbers up to 10.
  52. Make a program to display a pattern using even numbers.
  53. Write a program to check if two given words are anagrams (have the same letters, but in a different order) or not.
  54. Create a program to display the current date and time in Python.
  55. Make a program to calculate the number of days between two given dates.
  56. Write a program that generates 100 random lottery tickets and selects two lucky ones.
  57. Create a program to generate a secure 6-digit random One-Time Password (OTP).
  58. Make a program to generate a random date within a given range of start and end dates.
  59. Create a program to generate a random password with the following conditions:
    1. Password length must be 10 characters long.
    2. It must contain at least 2 uppercase letters, 1 digit, and 1 special symbol.
  60. Develop Python projects for a Guess the Number game and a Hangman game.
  61. Write a program to arrange characters in a string such that lowercase letters come first.
  62. Create a program to convert a CamelCase string to an underscore_case string. For example, “softloomItSolution” should become “softloom_it_solution.”
  63. Make a Python function to count the number of vowels and consonants in a given string.
  64. Given two strings, write a function to check if one string is a rotation of the other using only one call to a substring method
  65. Create a program to display a pattern using randomly generated numbers.
  66. Write a program to show a pyramid pattern using numbers less than 10.
  67. Make a program to display a pyramid pattern using numbers up to 10.
  68. Create a program to show a pattern using even numbers.
  69. Write a program to display a special pyramid pattern using digits.
  70. Make a program to show a pattern where each number is doubled in each column.

SoftLoom IT Training’s provides the best Python Training Course in Kochi. Whether you’re a beginner or looking to advance, our programs have you covered. Contact us now !