ASSIGNMENT QUESTION
Answer these questions in separate note book and submit on 23rd April 2024
1. Describe the collatz 3n+1 sequence and explain how iteration and conditions statements
are used in its implementation for n=6
2. What is meant by function composition? Illustrate with an example.
3. Explain how indexing operator and len() function applied on strings along with example
4. List and explain string operations in python for slicing, concatenation, repetition and
comparison with suitable example for each.
5. Explain break and continue statements with necessary examples.
6. Differentiate between a syntax error and a runtime error with examples.
7. Develop a program that takes a list of numbers and returns a new list containing only the
even numbers.
8. Write python program to calculate factorial of n number.
9. Write a python program to find the sum of elements in tuple.
10. Write a python program to sort a given list of numbers using bubble sort in ascending
order.
11. Write a python program to find Fibonacci sequence of given N terms. Read N from the
console.
12. Develop a program that prints all numbers from 1 to 100 that are divisible by 3 or 5 but
not both. Use continues or breaks statements wherever suitable.
13. Develop a Python program to check if a string is a palindrome using slicing.
14. Develop a program to read the name and year of birth of a person. Display whether the
person is a senior citizen or not.