python
python
Write a program that prompts the user to input a number. Use a try-except block to
catch:
Create a list of 5 numbers. Write a program that asks the user for an index and
tries to access the element at that index. Use try-except to handle:
Write a program that creates a list of integers. Use the max() and min() functions
to find and print the largest and smallest numbers in the list.
----------------------------------
4. List Functions: Remove Duplicates
Write a program that takes a list with duplicate elements (e.g., [1, 2, 2, 3, 3, 3,
4]) and removes duplicates using the set() function. Print the list without
duplicates.
-----------------------------------------
5. List Functions: Reverse a List
Write a program that creates a list of strings. Use the reverse() function to
reverse the list and print the reversed list.
------------------------------------------------
6. List Functions: Insert at a Specific Position
---------------------------------------------------------------
Write a program that creates a list of numbers. Insert the number 99 at the third
position using the insert() function and print the modified list.
Write a function multiply(a, b) that takes two numbers as input and returns their
product. Test the function with different values for a and b.