0% found this document useful (0 votes)
4 views2 pages

Acc 2

Uploaded by

bkkarbkkar571
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Acc 2

Uploaded by

bkkarbkkar571
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1.a) A string sub = “Computer Science” is defined.

Give Python statements

to: Display last three characters of sub.

b) What is a nested list?


c)Write the code to create an empty string str
d) What is list()?

e) What do you mean by traversing a string .


f) A string sub = “Computer Science” is defined. Give Python statements to:
Repeat sub four times.

g) Write the output of the following.

list1 = [0, 2,4,6,8,10]

list1.clear()

print(list1)

h) What is the difference between slicing and indexing of list.

i) Write a code to create a list of any four fruits named ‘fruit’.

j) What is the difference between extend() function and append() function

Long question

(i) Write a program that takes a string with multiple words and capitalizes the first
letter of each word and forms a new string out of it.

(ii) Write a program that reads a string and check whether it is a palindrome string or
not.

(iii) Write a program to accept 10 numbers from the user, if the number is odd, and
then add that number to the list.

(iv) Write a python program to find the frequency of a number in a list.

(v) `Name a python function to:

(a) delete a given element from the list.

(b) add an element in the beginning of the list

(c) Get the position of an item in the list.


(d) Add single item at the end of the list.

(e) Add elements in a list at the end of another list.

You might also like