20 Basic Python Practice Questions
1 Write a Python program to print 'Hello, World!'.
2 Write a program to take a number as input and print it.
3 Write a program to add two numbers entered by the user.
4 Write a program to check if a number is even or odd.
5 Write a program to check if a number is positive, negative, or zero.
6 Write a program to find the largest of three numbers.
7 Write a program to check if a year is a leap year.
8 Write a program to print numbers from 1 to 10 using a loop.
9 Write a program to print the multiplication table of a number.
10 Write a program to find the sum of numbers from 1 to n.
11 Write a program to calculate the factorial of a number.
12 Write a program to reverse a string.
13 Write a program to check if a string is a palindrome.
14 Write a program to count vowels in a string.
15 Write a program to find the largest element in a list.
16 Write a program to find the sum of all elements in a list.
17 Write a program to remove duplicates from a list.
18 Write a function to add two numbers and return the result.
19 Write a function to check if a number is prime.
20 Write a function to calculate the square of a number.