Read and download free pdf of CBSE Class 12 Computer Science Functions In Python Assignment. Get printable school Assignments for Class 12 Computer Science. Class 12 students should practise questions and answers given here for Functions In Python Computer Science in Class 12 which will help them to strengthen their understanding of all important topics. Students should also download free pdf of Printable Worksheets for Class 12 Computer Science prepared as per the latest books and syllabus issued by NCERT, CBSE, KVS and do problems daily to score better marks in tests and examinations
Assignment for Class 12 Computer Science Functions In Python
Class 12 Computer Science students should refer to the following printable assignment in Pdf for Functions In Python in Class 12. This test paper with questions and answers for Class 12 Computer Science will be very useful for exams and help you to score good marks
Functions In Python Class 12 Computer Science Assignment
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 Computer network Assignment |
CBSE Class 12 Computer Science Communication And Network Concepts Notes |
CBSE Class 12 Computer Science Functions In Python Assignment
We hope you liked the above assignment for Functions In Python which has been designed as per the latest syllabus for Class 12 Computer Science released by CBSE. Students of Class 12 should download and practice the above Assignments for Class 12 Computer Science regularly. We have provided all types of questions like MCQs, short answer questions, objective questions and long answer questions in the Class 12 Computer Science practice sheet in Pdf. All questions have been designed for Computer Science by looking into the pattern of problems asked in previous year examinations. You can download all Revision notes for Class 12 Computer Science also absolutely free of cost. Lot of MCQ questions for Class 12 Computer Science have also been given in the worksheets and assignments for regular use. All study material for Class 12 Computer Science students have been given on studiestoday. We have also provided lot of Worksheets for Class 12 Computer Science which you can use to further make your self stronger in Computer Science.
What are benefits of doing Assignment for CBSE Class 12 Computer Science Functions In Python?
a. Score higher marks: Regular practice of Computer Science Class 12 Assignments for chapter Functions In Python will help to improve understanding and help in solving exam questions correctly.
b. As per CBSE pattern: All questions given above follow the latest Class 12 Computer Science Sample Papers so that students can prepare as per latest exam pattern.
c. Understand different question types: These assignments include MCQ Questions for Class 12 Computer Science with answers relating to Functions In Python, short answers, long answers, and also case studies.
d. Improve time management: Daily solving questions from Functions In Python within a set time will improve your speed and accuracy.
e. Boost confidence: Practicing multiple assignments and Class 12 Computer Science mock tests for Functions In Python reduces exam stress.
How to Solve CBSE Class 12 Computer Science Functions In Python Assignment effectively?
a. Start with Class 12 NCERT and syllabus topics: Always read the chapter carefully before attempting Assignment questions for Class 12 Computer Science Functions In Python.
b. Solve without checking answers: You should first attempt the assignment questions on Functions In Python yourself and then compare with provided solutions.
c. Use Class 12 worksheets and revision notes: Refer to NCERT Class 12 Computer Science worksheets, sample papers, and mock tests for extra practice.
d. Revise tricky topics: Focus on difficult concepts by solving Class 12 Computer Science MCQ Test.
e. Maintain notebook: Note down mistakes in Functions In Python assignment and read them in Revision notes for Class 12 Computer Science
How to practice CBSE Class 12 Computer Science Functions In Python Assignment for best results?
a. Solve assignments daily: Regular practice of Functions In Python questions will strengthen problem solving skills.
b.Use Class 12 study materials: Combine NCERT book for Class 12 Computer Science, mock tests, sample papers, and worksheets to get a complete preparation experience.
c. Set a timer: Practicing Class 12 Computer Science Functions In Python assignment under timed conditions improves speed and accuracy.
You can download free Pdf assignments for CBSE Class 12 Computer Science Functions In Python from StudiesToday.com
All topics given in Functions In Python Computer Science Class 12 Book for the current academic year have been covered in the given assignment
No, all Printable Assignments for Functions In Python Class 12 Computer Science have been given for free and can be downloaded in Pdf format
Latest syllabus issued for current academic year by CBSE has been used to design assignments for Functions In Python Class 12
Yes, we have provided detailed answers for all questions given in assignments for Functions In Python Class 12 Computer Science