CBSE Python(083) Class 12 tuple assignment programs
- Write a Python program that creates a tuple storing first 9 terms of Fibonacci series.
Output:
2. (a) Write a program that receives the index and returns the corresponding value.
Output:
2 (b) Write a program that receives a Fibonacci term and returns a number telling which term it is for instance, if you pass 3, it returns 5, telling it is 5th term; for 8, it returns 7.
Output:
3. Write a program that interactively creates a nested tuple to store the marks in three subjects for five students, i.e., tuple will look somewhat like:
((45,45,40),(35,40,38),(36,30,38),(25,27,20),(10,15,20))
Output:
4. In the program created in the previous question, add a function that computes total marks and average marks obtained by each student.
Output:
5. Write a program that inputs two tuples and creates a third, that contains all elements of the first followed by all elements of the second.
Output:
6. Write a program as per following specification: return the length of the shortest string in the tuple of strings str_tuple. Precondition: the tuple will contain at least one element.
Output:
7. Create the following tuples using a for loop:
(a) A tuple containing the squares of the integers 1 through 50.
Output: