Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

WEEKLY TEST - 2

CLASS: XI MARKS: 30
SUBJECT: COMPUTER SCIENCE
I. Answer the following (5*1 =5)

1. Strings are Mutable/Immutable?


2. name=’hello’
name[0]=’p’
What will be the output of the code?
3. “a” !=”abc” will give
4. What is an Easy way to reverse a String?
5. Which function is used to find length of the given string/list?

II.Answer the Following (3*2=6)

6. What are String Operators? Give Example.


7. How to determine ASCII/Unicode value of a single Character?
8. Difference between Lists and Strings?

III.Answer the Following (3*3=9)


9. Explain <Str>.partition(sep) with example program.
10.What is the difference between (30) and (30,)? with example program
11.What are two ways to remove something from a list? How are they different?

IV. Answer the Following (2*5=10)


12.Write a python program code segment that prints the longest word in a list of words.
13.Write a program that should prompt the user to type some sentence followed by “enter”.
it should then print the original sentence and the following statistics relating to the
sentence(s).
 Number of words
 Number of characters(including whitespace and punctuation
 Percentage of characters that are alpha numeric.

You might also like