Anishka Python
Anishka Python
2. Write a Python program that takes input in minutes and converts minutes into seconds.
The program should perform the conversion, and print the result.
seconds = minutes * 60
3. Write a Python program that takes a number as input from the user and prints whether it
is odd or even.
if num % 2 == 0:
print(f"{num} is even")
else:
print(f"{num} is odd")
4. Write a Python program that checks if a given year is a leap year or not. HINT- A leap
else:
5. Write a Python program that takes three numbers as input from the user and prints the
largest among them.
largest = num1
largest = num2
else:
largest = num3
6. Write a Python program that checks if a person is eligible to vote or not. HINT- Age
7. Write a Python program that uses a for loop to print even numbers and odd numbers from
20 to 40.
if i % 2 == 0:
print(i)
if i % 2 != 0:
print(i)
8. Write a Python program that takes a number as input from the user and prints its
multiplication table.
factorial = 1
factorial *= i
10. Write a Python program that print sum of first n numbers. Input n from user.