Python Built in Function
Python Built in Function
Python Built in Function
G B PUBLIC SCHOOL
CLASS XII REVISION SHEET
Python Built-in-functions Questions
1. Write the output of the code given below: 2 MARK IN YOUR BOARD
list= [10, 20, 30, 40, 50, 60, 70, 80] EXAM Q.NO 23
print(list[ : : -2])
4. Rahul wants to round a number down to the nearest smallest integer. Write the
Python commands to import the required module (using built-in function) and
display the nearest smallest integer to the given number x.
5. Write a Python statement for each of the following tasks using BUILT-IN
functions/methods only.
(i) To find the minimum value from a list named ‘Numbers’.
(ii) To find and print the length of words from the list.
6. Write the Python statement for each of the following tasks using BUILT-IN
functions/methods only:
(i) To insert an element 200 at the third position, in the list L1.
(ii) To check whether a string named, message ends with a full stop / period or not.
7. A list named studentAge stores age of students of a class. Write the Python command
to import the required module and (using built-in function) to display the most
common age value from the given list.
8. Write a suitable Python statement for each of the following tasks using built-in
functions/methods only:
i To delete an element Mumbai:50 from Dictionary D.
ii To display words in a string S in the form of a list
10. Write the Python statement for each of the following tasks using BUILT-IN
functions/methods only:
i. To return index position of substring in given string.
ii. To delete first occurrence of an item in the list
11. A list named stu_marks stores marks of students of a class. Write the Python
command to import the required module and display the average of the marks in
the list.
12. Write the Python statement/function for each of the following tasks using BUILT-IN
functions/methods only:
i. To return index position of substring in given string.
ii. To delete first occurrence of an item in the list
13. A list named stu_marks stores marks of students of a class. Write the Python
command to import the required module and display the average of the marks in
the list.
14. Write the Python statement for each of the following tasks:
(i) str="PYTHON@LANGUAGE"
To print the above string from index 2 onwards using a single statement.
(ii)To initialize an empty dictionary named as d using BUILT_IN
fuctions/ methods only
15. Write the Python statement for each of the following tasks using BUILT_IN
fuctions/ methods only:
(i) s=”LANGUAGE"
To convert the above string into list.
(ii)To initialize an empty tuple named as t.
16. Write the Python statement for each of the following tasks using BUILT-IN
functions/methods only:
i) To Join all items in a tuple( t) into a string( x ), using a hash character as
separator:
ii) To sort a list (L1) in descending order and returns a new sorted list (L2)
without changing the original list
17. A list named studentAge stores age of students of a class. Write the Python
command to import the required module and (using built-in function) to
display the most common age value from the given list.
18. Write the Python statement for each of the following tasks using BUILT-IN
functions/methods only:
(i) To insert an element 400 at the fourth position, in the list L1.
(ii) To check whether a string named, message ends with a full stop / period or not.