Python Class Test
Python Class Test
Q1. How are lists different from strings when both are sequences?
Q2. How are tuples different from lists when both are sequences?
Q3. Write a program that takes a string with multiple words and then
capitalizes the first letter of each word and forms a new string out
of it.
Q4. Write a program to print alternate characters in a String where
string is entered by the user.
Q5. Write a python function secondLargest(T) which takes as input a tuple T
and returns the second largest element in the tuple.
(May use inbuilt functions too)
Q6. Write a function getPowers(x) that returns a tuple containing x,x 2,x3,and x4.
Read five integers from the user and for each integer read,
print that value raised to the powers 2,3 and 4.
Q12.
Create a 5X2 integer array using Numpy from a range between 100 to 200 such that t
difference between each element is 10