Functions
CBSE · Class 11 · Computer Science
NCERT Solutions for Functions — CBSE Class 11 Computer Science.
Interactive on Super Tutor
Studying Functions? Get the full interactive chapter.
Quizzes, flashcards, AI doubt-solver and a step-by-step study plan — built for ncert solutions and more.
1,000+ Class 11 students started this chapter today
4 worked solutions below. Unlock all 7 free in Super Tutor
EXERCISE
1Observe the following programs carefully, and identify the error:Show solution
b) `cos()` is used but it is not imported. The program imports only `sqrt` and `ceil` from `math`, so `cos` will cause an error. It should import `cos` too, or use `math.cos(0)` after importing `math`.
c) The function tries to modify `mynum` inside the function without declaring it global. So `mynum = mynum + 9` causes an error because Python treats `mynum` as a local variable, but it is used before assignment. It should use `global mynum` inside the function if the global variable is to be changed.
d) The function header is incorrect because a parameter with a default value must be the trailing parameter. Here `val1 = 1.1` comes before `val2` and `val3`, which is not allowed. Also, the function call is written as `findvalue()` but the function name is `findValue()`.
e) The function call is written incorrectly. `greet() = message` is invalid because a function call cannot be on the left side of assignment. It should be `message = greet()`.
Not sure why a step works? check your working in Super Tutor
2How is math.ceil(89.7) different from math.floor(89.7)?Show solution
`math.floor(89.7)` gives the greatest integer less than or equal to 89.7, so it is 89.
So, ceil rounds up and floor rounds down.
Not sure why a step works? check your working in Super Tutor
3Out of random() and randint(), which function should we use to generate random numbers between 1 and 5. Justify.Show solution
`random()` gives a random real number between 0.0 and 1.0, so it is not suitable for directly generating integers from 1 to 5.
Not sure why a step works? check your working in Super Tutor
4How is built-in function pow() function different from function math.pow() ? Explain with an example.Show solution
- `pow(x, y)` is a built-in function. It returns .
- `math.pow(x, y)` belongs to the math module. It also returns , but as a float.
Example:
- `pow(5, 2)` gives 25
- `math.pow(5, 2)` gives 25.0
Also, `math.pow()` requires importing the math module.
Not sure why a step works? check your working in Super Tutor
3 more solved questions in Functions
Every remaining exercise is solved step by step in Super Tutor, plus practice quizzes and flashcards for this chapter. Free to start.
Stuck on a step?
Ask Super Tutor AI to explain any solution on this page in a simpler way — free, 24x7.
Ask a Doubt FreeFrequently Asked Questions
What are the important topics in Functions for CBSE Class 11 Computer Science?
How to score full marks in Functions — CBSE Class 11 Computer Science?
Where can I get free NCERT Solutions for Functions Class 11 Computer Science?
Sources & Official References
- NCERT Official — ncert.nic.in
- CBSE Academic — cbseacademic.nic.in
- CBSE Official — cbse.gov.in
- National Education Policy 2020 — education.gov.in
Content is aligned to the official syllabus. Refer to the board website for the latest curriculum.
More resources for Functions
Practice Quiz
Test yourself with a quick quiz
Important Questions
Practice with board exam-style questions
Revision Notes
Key points for last-minute revision
Formula Sheet
All formulas in one place
Chapter Summary
Understand the chapter at a glance
Concept Maps
See how topics connect visually
Study Plan
Step-by-step plan to ace this chapter
Flashcards
Quick-fire cards for active recall
Syllabus
What topics to cover
For serious students
Get the full Functions chapter — for free.
Quizzes, flashcards, AI doubt-solver and a step-by-step study plan for CBSE Class 11 Computer Science.