CBSE Class 12 Computer Science Functions In Python Assignment

Here is the CBSE Class 12 Computer Science Functions In Python Assignment for your homework and practice. Download Class 12 Computer Science school assignments for the 2026-27 session, complete with answers for Functions In Python. These expert-curated exercises match current curriculum rules from NCERT, CBSE, and KVS.

Download Class 12 Computer Science Functions In Python Homework PDF

Try solving these Class 12 Computer Science problems routinely to strengthen your subject knowledge. These printable worksheets for Functions In Python cover varied question levels, helping Class 12 students evaluate their progress and achieve higher exam grades.

Functions In Python Questions & Answers for Class 12 Computer Science

Short Answer Type Questions :

Question: What is default parameter?
Answer: A parameter having default value in the function header is known as a default parameter.

Question: What is a Library in Python?
Answer: A Library is a collection of modules that together caters to specific types of needs or applications.Like NumPy library of Python caters to scientific computing needs.

Question: Is it necessary to have a base case in a recursive function?
Answer: Yes

Question: What is base case in recursion?
Answer: Preknown case of recursive function, whose solution is pre-known is called base case.

Question: What is recursion?
Answer: Recursion refers to a programming technique in which function calls itself either directly or indirectly.,

Question:. What is module in Python?
Answer: A module is a file with .py extension that contains variables, class definitions, statements and functions related to a particular task.

Question: When is recursion endless?
Answer: An infinite recursion is when recursive function calls itself endlessly.

Question: Array for binary search should be sorted or not?
Answer: Yes

Question: Can a function return multiple values in python?
Answer: YES.

Question: What will be the output of the following code?
a=1
def f():
a=10
print(a)

Answer: The code will print 1 to the console.

Question: Consider the following function headers. Identify the correct statement: –
1) def correct(a=1,b=2,c): 2) def correct(a=1,b,c=3):
3) def correct(a=1,b=2,c=3): 4) def correct(a=1,b,c):

Answer: – 3) def correct(a=1,b=2,c=3)

Question: Write the features of a module.
Answer: – 1) Modules can be reused in other programmes
2) It is independent group of code and data

Question: Create a package ArithmeticOperations (named AO) contain sum, product and difference of two numbers and use it in your main programme.
Answer: – def ADD(X,Y):
return (X+Y)
def PRODUCT(X,Y):
return(X*Y)
def DIFFERENCE(X,Y):
return(X-Y)
Now lets save this file as AO.py then our module is created now.
Now we are creating our main python file: –
import AO
n1=int(input(‘Enter a Number’))
n2=int(input(‘Enter another Number’))
print(‘Sum = ‘, AO.ADD(n1,n2))
print(‘Difference=’,AO.DIFFERENCE(n1,n2))
print(‘Product=’,AO.PRODUCT(n1,n2))

Question: Find the output:
a) def out(n):
if(n==0):
return
else:
out(n-1)
print(n)
n=6
out(n)
b) def sum(n):
if(n==1):
return 1
return n*n+sum(n-1)
n=4
print(“Sum is:”,sum(n))
c) def compute(a,b):
if(b==0):
return a
else:
return compute(a,a%b)
a=6
b=2
c=compute(a,b)
print(“Computer data:”,c)
Answer: a) 
1
2
3
4
5
6
b) Sum is: 30
c) Computer data: 6

Question: What are the advantage and disadvantage of recursion?
Answer: Advantages of Recursion:
i. Recursive functions make the code look clean and elegant.
ii. A complex task can be broken down into simpler sub-problems using recursion.
iii. Sequence generation is easier with recursion than using some nested iteration.
Disadvantages of Recursion:
i. Sometimes the logic behind recursion is hard to follow through.
ii. Recursive calls are expensive (inefficient) as they take up a lot of memory and time.
iii. Recursive functions are hard to debug.

Question: Write recursive code to compute the factorial of an integer.
Answer: def calc_factorial(x):
if x == 1:
return 1
else:
return (x * calc_factorial(x-1))
num = 4
print(“The factorial of”, num, “is”, calc_factorial(num))

Question: Rewrite the correct code after removing the errors: –
def SI(p,t=2,r):
return (p*r*t)/100

Answer: – def SI(p, r, t=2):
return(p*r*t)/100

Application Based Questions :

Question: How many values a python function can return? Explain how?
Answer: Python function can return more than one values.
def square_and_cube(X):
return X*X, X*X*X, X*X*X*X
a=3
x,y,z=square_and_cube(a)
print(x,y,z)

Question: Predict the output of the following code fragment?
def check(n1=1, n2=2):
n1=n1+n2
n2+=1
print(n1,n2)
check()
check(2,1)
check(3)

Answer: 3 3
3 2
5 3

Question: Write a python program to sum the sequence given below. Take the input n from the user.   img
Answer: def fact(x):
j=1 , res=1
while j<=x:
res=res*j
j=j+1
return res
n=int(input(“enter the number : “))
i=1, sum=1
while i<=n:
f=fact(i)
sum=sum+1/f
i+=1
print(sum)

Question: Write a program to compute GCD and LCM of two numbers def gcd(x,y):
Answer: while(y):
x, y = y, x % y
return x
def lcm(x, y):
lcm = (x*y)//gcd(x,y)
return lcm
num1 = int(input(“Enter first number: “))
num2 = int(input(“Enter second number: “))
print(“The L.C.M. of”, num1,”and”, num2,”is”, lcm(num1, num2))
print(“The G.C.D. of”, num1,”and”, num2,”is”, gcd(num1, num2))

CBSE Class 12 Computer Science Assignments for Functions In Python

Revision Assignment: Functions In Python (CBSE)

Download curated Functions In Python assignments aligned with current CBSE standards for Class 12. Built for comprehensive practice, the sheets incorporate MCQs, short answer questions, and long-form problems for Functions In Python. Save files easily in PDF format for offline use. Compiled by experienced educators, these tasks provide exact alignment with recurring school examination patterns.

Maximize Your Exam Scores with Class 12 Computer Science Assignments

  • Improved Grades: Regular drills on Functions In Python concepts lead to higher confidence and correct exam answers.
  • Current Standards: Sets are updated to reflect the latest CBSE sample papers and evaluation criteria.
  • Comprehensive Coverage: Features Case Studies, MCQs, and structured descriptive problems with complete answers for Functions In Python.
  • Pacing Control: Daily practice with Functions In Python evaluation sheets sharpens test-taking speed and accuracy.

Effective Strategy for Class 12 Computer Science Assignments

  1. Core Preparation: Go through the NCERT book for Class 12 Computer Science to build strong fundamentals before practice.
  2. Solo Problem Solving: Try working through the Functions In Python questions independently before checking our solutions.
  3. Helpful Assets: Use our Revision Notes and Class 12 worksheets if any specific topic creates confusion.
  4. Progress Monitoring: Note down complex formulas or concepts, clearing them up with our online MCQ tests.

Best Practices for Class 12 Computer Science Preparation

For the best results, solve one assignment for Functions In Python on a daily basis. Using a timer while practicing will further improve your problem-solving skills and prepare you for the actual CBSE exam.

FAQs

Where can I download the latest CBSE Class 12 Computer Science Functions In Python assignments?

You can download free PDF assignments for Class 12 Computer Science Functions In Python from StudiesToday.com. These practice sheets have been updated for the 2026-27 session covering all concepts from latest NCERT textbook.

Do these Computer Science Functions In Python assignments include solved questions?

Yes, our teachers have given solutions for all questions in the Class 12 Computer Science Functions In Python assignments. This will help you to understand step-by-step methodology to get full marks in school tests and exams.

Are the assignments for Class 12 Computer Science Functions In Python based on the 2026 exam pattern?

Yes. These assignments are designed as per the latest CBSE syllabus for 2026. We have included huge variety of question formats such as MCQs, Case-study based questions and important diagram-based problems found in Functions In Python.

How can practicing Functions In Python assignments help in Computer Science preparation?

Practicing topicw wise assignments will help Class 12 students understand every sub-topic of Functions In Python. Daily practice will improve speed, accuracy and answering competency-based questions.

Can I download Computer Science Functions In Python assignments for free on mobile?

Yes, all printable assignments for Class 12 Computer Science Functions In Python are available for free download in mobile-friendly PDF format.