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
You are on page 1/ 1
PYTHON – REVISION WORKSHEET
1. Illustrate the use of the following:
a. upper( ) b. capitalize( ) c. lower( ) d. len( ) e. Index operator f. * 2. Write the output: a. print(“This is computer”.capitalize( )) b. print(“Computer”.upper( )) c. print(“Computer”.islower( )) d. print(“abc234”.isdigit( )) e. print(“98765”.isdigit( )) f. print(“qwerty”.isalpha( )) g. print(len(“This is computer”)) h. print(“Computer”.lower( )) i. a=”computer” print(a[5] print(a[-4] print(a[2:6] 3. Apply the suitable operator to perform the following: a. To check whether the letter “I” is present in the word “IHS”. b. To display the word “HELLO” 3 times c. To check the length of the string “Python” d. To capitalize the first letter of the word “Hello”