0% found this document useful (0 votes)
3 views1 page

Assignment Question

The document outlines an assignment with various programming questions to be answered and submitted by April 23, 2024. Topics include the Collatz sequence, function composition, string operations, control statements, error differentiation, and several Python programming tasks such as calculating factorials, sorting lists, and checking for palindromes. Each question requires a separate notebook entry, emphasizing practical coding skills and understanding of Python concepts.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Assignment Question

The document outlines an assignment with various programming questions to be answered and submitted by April 23, 2024. Topics include the Collatz sequence, function composition, string operations, control statements, error differentiation, and several Python programming tasks such as calculating factorials, sorting lists, and checking for palindromes. Each question requires a separate notebook entry, emphasizing practical coding skills and understanding of Python concepts.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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.

You might also like