Q.1: Which of the function return the smallest integer not less than number .
a) exp()
b) ceil()
c) floor()
d) fabs()
Q.2:Which of the following is not a type of function ?
a) built in function
b) function defined in modules
c) user defined function
d) python function
Q.3 : …………… is a reserved word for defining a function .
a) fun
b) def
c) define
d) pyfun
Q.4:What is the output of math.ceil(89.7)?
a) 90
b) 7
c) 89
d) 80
Q.5:What is the another name of parameters ?
a) formal argument
b) actual argument
c) actual parameters
d) none of these
Q.6: Out of the following ,which function should we use to generate random numbers between 1 and 5 ?
a) random()
b) randint()
c) range()
d) generate()
Q.7:What is the default value of a function that does not return any value ?
a) None
b) int
c) double
d) null
Q.8: A _______ is a file( .py file ) that contains variables , class , statements related to particular task.
a) function
b) module
c) docstring
d) none of these
Q.9:Which of the following is the form of import statement ?
a) import<module name>
b) from <module> import <object>.
c) import py.<module name>
d) all of these
Q.10:The help statement display __________ from a module .
a) constants
b) fuctions
c) classes
d) docstrings
Q.11: A ______ is a named block of statements that can be invoked by its name .
Q.12: The ______ function returns the largest integer not greater than number.
Q.13:The ______ module of python provides random number generation functionality .
Q.14:How are the following two statements differ from one another ?
a) Import maths
b) From maths import*
Q.15 :What is the utility of random module ?
Q.16 :What is the significance of modules?
Q.17: What is the role of an argument of a function?
Solution for Worksheet on Functions and modules in Python
Q.1: Which of the function return the smallest integer not less than number .
b) ceil()
Q.2:Which of the following is not a type of function ?
d) python function
Q.3 : …………… is a reserved word for defining a function .
b) def
Q.4:What is the output of math.ceil(89.7)?
a) 90
Q.5:What is the another name of parameters ?
a) formal argument
Q.6: Out of the following ,which function should we use to generate random numbers between 1 and 5 ?
b) randint()
Q.7:What is the default value of a function that does not return any value ?
a) None
Q.8: A __________ is a file( .py file ) that contains variables , class , statements related to particular task.
b) module
Q.9:Which of the following is the form of import statement ?
c) import py.<module name>
Q.10:The help statement display ______ from a module .
d) docstrings
Q.11: A _____ is a named block of statements that can be invoked by its name .
Answer : function
Q.12: The ______ function returns the largest integer not greater than number.
Answer : floor()
Q.13:The ______ module of python provides random number generation functionality .
Answer : random
Q.14:How are the following two statements differ from one another ?
a) Import maths and b) From maths import*
Answer:
When you type ‘import math’ you are importing all functions and classes in the math module but when you type ‘from math import [name of class]’, you only get access to that class in the whole module. you may write this ‘from math import *’ to import everything from the “from” statement
Q.15 :What is the utility of random module ?
Answer:
Python Random module is an in-built module of Python which is used to generate random numbers. These are pseudo-random numbers means these are not truly random. This module can be used to perform random actions such as generating random numbers, print random a value for a list or string, etc
Q.16 :What is the significance of modules?
Answer:
A module allows you to logically organize your Python code. Grouping related code into a module makes the code easier to understand and use. A module is a Python object with arbitrarily named attributes that you can bind and reference. Simply, a module is a file consisting of Python code.
Q.17: What is the role of an argument of a function?
Answer:
Arguments are inputs to functions; they allow a function to produce different (but appropriate) outputs for different inputs.The terms parameter and argument can be used for the same thing: information that are passed into a function. From a function’s perspective: A parameter is the variable listed inside the parentheses in the function definition. An argument is the value that are sent to the function when it is called.
Class 11 Computer Science Sample Paper MCQ based Term 2 Set-1 Term 2 Examination 2021-22 Class-XI Time:- 1.5 Hours Max. Mark:35 General instructions:- 1. This Question Paper Contains 4 Parts A,B,C,D. 2. Attempt 11 questions in Part-A and all questions in Part-B, C and D. 3. Each Question in Part A carry 1…
Data Structures Class 12 Notes DATA STRUCTURES A data structure defines a mechanism to store, organise and access data along with operations (processing) that can be efficiently performed on the data. A data structure is a group of data that have different data types which can be accessed as a unit . For example, string…
Last updated on February 26th, 2024 at 07:54 pmComputer Science Practical Question Paper Sample A.I.S.S.C.E. Practical Examination Subject: Computer Science (083) Time 3 Hrs/MM:30 SET- 1 1- Write a program to input a list and interchange first with last, second with second last …. Print the list in reverse order.(7 marks) 2- Write a…
Last updated on February 8th, 2022 at 11:19 amCreate a dictionary with the roll number, name and marks of n students in a class and display the names of students who have scored marks above 75. Program no_of_std = int(input(“Enter number of students: “)) result = {} for i in range(no_of_std): print(“Enter Details of…
80+ Important MCQ on Computer Network Class 12 1. A Computer Network: a) Is a collection of hardware components and computers? b) Is interconnected by communication channels c) Allows sharing of resources and information d) All of the above 2. What is a Firewall in computer network? a) The physical boundary of network…
Last updated on June 26th, 2025 at 10:56 pmMCQs on Flow of control, conditional statements Topic: OUTPUT,ERRORS,FLOW OF CONTROL,CONDITIONAL STATEMENTS Q.1 Which one of the following is a valid Python if statement : a) if a>=2 : b) if (a >= 2) c) if (a => 22) d) if a >= 22 Q.2 Which…