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 Machine Test Interview Questions on Python
- 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.
- 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.
- 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.
- 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).
- 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.
- 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.
- 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.
- 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.
- 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.
- Create a simple calculator program in Python. Ask the user for two numbers and an operation (+, -, *, /). Then, display the result of the operation.
- 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.
- Write a Python program to show the first 10 numbers in the Fibonacci sequence.
- Create a program that asks for a number and then displays its multiplication table up to 10.
- Make a program that counts and tells the user how many digits are in a given number.
- Write a program to find the factorial of a number that the user enters.
- Create a program to find how many times a specific word appears in a sentence, considering both uppercase and lowercase versions.
- Write a program that takes a series of numbers as a text and calculates the sum and average of those numbers.
- Make a program that removes any empty words from a list of words.
- Create a python program to display a pattern of stars forming a right-aligned triangle.
- Make a python program to show a pattern of stars forming a left-aligned triangle in Pascal’s pattern.
- Write a python program to display a pattern of stars forming a sandglass shape.
- Create a program to show a pattern of stars forming a pant style shape.
- Make a program to display another pattern of stars forming a diamond shape.
- Write a program to create a pyramid pattern using horizontal multiplication tables.
- Create a program to display a pattern where each number is doubled.
- Make a program to show a pattern of random numbers.
- Write a program that counts how many letters, digits, and special characters are in a given sentence or word.
- Create a program that asks the user for their age. Depending on their age, calculate and show the ticket price for a movie theatre:
- Age 0-5: Free
- Age 6-17: Child ticket $50
- Age 18-59: Adult ticket $100
- Age 60 and above: Senior ticket $75
- Write a program that combines two lists into a dictionary. The lists are:
- Keys: [‘Ten’, ‘Twenty’, ‘Thirty’]
- Values: [10, 20, 30]
- Create a program that combines the information from two Python dictionaries into a single dictionary.
- 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]
- Write a program to display a pattern of stars forming a right-angled triangle pyramid.
- Create a program to show a pattern of stars forming a downward half-pyramid.
- Create a program to display a pattern of stars forming a full downward pyramid.
- Write a program to show a pattern of stars forming a right downward mirror.
- Make a program to display a pattern of stars forming an equilateral triangle.
- Create a program to print two pyramid patterns of stars.
- Write a program to display a pattern of stars forming a right-aligned triangle.
- Make a program to show a pattern of stars forming a left-aligned triangle in Pascal’s pattern.
- Create a program to display a pattern of stars forming a sandglass shape.
- Write a program to show a pattern of stars forming a pant style shape.
- Make a program to display a pattern of stars forming a right-angled triangle pyramid.
- Create a program to show a pattern of stars forming a downward half-pyramid.
- Write a program to display a pattern of stars forming a full downward pyramid.
- Make a program to show a pattern of stars forming a right downward mirror.
- Create a program to display a pattern of stars forming an equilateral triangle.
- Write a program to print two pyramid patterns of stars.
- Write a program to display a pyramid pattern using numbers less than 10.
- Create a program to show a pyramid pattern using numbers up to 10.
- Make a program to display a pattern using even numbers.
- Write a program to check if two given words are anagrams (have the same letters, but in a different order) or not.
- Create a program to display the current date and time in Python.
- Make a program to calculate the number of days between two given dates.
- Write a program that generates 100 random lottery tickets and selects two lucky ones.
- Create a program to generate a secure 6-digit random One-Time Password (OTP).
- Make a program to generate a random date within a given range of start and end dates.
- Create a program to generate a random password with the following conditions:
- Password length must be 10 characters long.
- It must contain at least 2 uppercase letters, 1 digit, and 1 special symbol.
- Develop Python projects for a Guess the Number game and a Hangman game.
- Write a program to arrange characters in a string such that lowercase letters come first.
- Create a program to convert a CamelCase string to an underscore_case string. For example, “softloomItSolution” should become “softloom_it_solution.”
- Make a Python function to count the number of vowels and consonants in a given string.
- 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
- Create a program to display a pattern using randomly generated numbers.
- Write a program to show a pyramid pattern using numbers less than 10.
- Make a program to display a pyramid pattern using numbers up to 10.
- Create a program to show a pattern using even numbers.
- Write a program to display a special pyramid pattern using digits.
- 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 !