0% found this document useful (0 votes)
5 views2 pages

Assignmet - 3

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Assignmet - 3

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1. What are conditional statements in Python?

2. What is the purpose of the if statement in Python?


3. What is the role of the elif statement in Python?
4. Explain the else statement in Python.
5. Can you nest conditional statements in Python?
6. What is a loop in Python?
7. What is a for loop in Python, write its syntax?
8. What is a while loop in Python, write its syntax?
9. What is the purpose of the break statement in Python loops?
10.What does the continue statement do in Python loops?
11.What is a function in Python?
12.How do you define a function in Python?
13.What are parameters and arguments in Python functions?
14.What is the purpose of the return statement in a function?
15.Can a Python function return multiple values?
16.Write a Python program to check if a number is positive, negative, or
zero.
17.Write a Python program to find the largest of three numbers.
18.Write a Python program to print all numbers from 1 to 10 using a for
loop.
19.Write a Python program to print the first 10 even numbers using a while
loop.
20.Write a Python program to calculate the sum of all numbers from 1 to
100 using a for loop.
21.Write a Python function that takes a number as an argument and returns
its factorial.
22.Write a Python function that takes a number as an argument and returns
table of that number. (eg. table of 2 is 2,4,6,8,……).
23.Write a Python function to check if a number is prime.
24.Write a Python function that returns the maximum of two numbers.
25.Write a Python function that prints the Fibonacci sequence up to n
terms.
26.Write a Python program that uses a function to check if a given year is a
leap year.
27.What is a lambda function in Python?
28.Explain the concept of recursion with an example.
29.What are local and global variables in Python?
30.What is the difference between return and print in Python?
31.Write a Python function to calculate the sum of squares of the first n
natural numbers using a loop.
32.Write a Python program using a lambda function to filter even numbers
from a list.
33.Write a recursive function to compute the Fibonacci sequence up to n
terms.
34.Write a Python program that demonstrates the use of global variables.
35.Write a Python function that uses a loop and conditional statement to
reverse a string.
36.Write a Python program to find the sum of even numbers from 1 to 100
using a loop and conditional statement.
37.Write a Python function to find the greatest common divisor (GCD) of
two numbers using recursion.
38.Write a Python program to find the smallest of three numbers using
conditional statements.
39.Write a Python program to count the number of vowels in a given string
using a loop.
40.Write a Python function to check if a string is a palindrome.
41.Write a Python function that returns the factorial of a number using a
loop.

You might also like