SELECT *
FROM (`youtube_videos`)
WHERE `display_status` = 1
ORDER BY `video_id` desc
LIMIT 1SELECT *
FROM (`youtube_videos`)
WHERE `display_status` = 1
ORDER BY `video_id` desc 12th Standard CBSE Computer Science Functions Important Questions 12th Standard CBSE Computer Science What will be the output of the following code? type "int' Error < class "int' > What will be the output of the following code? Error a b c d ['a':b':c':d'] None What is called when a function is defined inside a class? Module Class Another function Method Which of the following is the use of idf) function in python? Id() returns the identity of the object Every object doesn't have a unique ID All of the mentioned None of the mentioned Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list after list1.pop(1)? [3,4, 5, 20, 5, 25, 1, 3] [1, 3, 3, 4, 5, 5, 20, 25] [3,5, 20, 5, 25, 1, 3] [1,3,4,5,20,5,25] Find and write the output of the following Python code: What do you understand by local and global scope of variables? How can you access a global variable inside the function, if function has a variable with same name. What are the possible outcome(s) executed from the following code? Also specify the maximum and minimum values that can be assigned to variable How can we import a module in Python? What are the differences between parameters and arguments? What are default arguments? What are keyword arguments? What are the advantages of keyword arguments? Write a generator function generatesq ( ) that displays the square roots of numbers from 100 to n where n is passed as an argument. What are the advantages of dividing a program into modules. Differentiate between Built-in functions and user defined functions. Differentiate between Built-in functions and functions defined in modules. Write a program that reads a number, then converts it into octal, hexadecimal, ASCII and Unicode string using built in functions of Python. Write the corresponding Python expression for the following mathematical expressions: Write a Python program using functions to calculate area of a triangle after obtaining its three sides. How are following two statements different? What will be the output of the following code What is an execution frame? What is the difference between passing mutable type arguments and immutable type arguments to the function? What are Positional arguments? Is indentation required in Python? What is a default parameter? How is it specified? From the function calls given below for a function defined as def fun(p,t,r=7, c=8): determine which is valid and which one is invalid. Give reasons. What is name resolution rule? Explain it. What will be the output of the following program.? Spot the errors and rewrite the corrected codes. What will following function print when called? Predict the output of the following codes. Write a function to calculate volume of a box with appropriate default values for its parameters. Your function should have the following input parameters: Write a function that takes a number as argument and calculates cube for it. The function does not return a value. If there is no value passed to the function in function call, the function should calculate cube of 2. Write a function that receives two string arguments and checks whether they are same-length strings (returns True in this case otherwise False) Write a function namely nthRoot() that receives two parameter x and n and return nth root of x ie. x1/n The default value of n is 2 Write a function that takes two numbers and returns the number that has minimum one's digit. Write a void function that receives a 4 digit number and calculates the sum of squares of first two digits of the number and last two digits of the number egoif 1233 is passed as argument then function should calculate (12)2+(33)2 Write a function to swap two numbers. What are the rules to define a' function in Python? What does the len() function do? How can you make a module 'helloworld' out of these two functions? Define pow(x, y) function in Python. What is a Python module? What is its significance? "Python has certain functions that you can readily use without having to write any special code." What type of functions are these ? What is the utility of built-in function help () ? What is the utility of Python standard library's math module and random module? Explain Scope of Variables. Find the error What would be the output produced by the following code: Find the error(s) in the following code and correct them: Write a function that: What would be the output of the following ? What do you mean by globals() and locals() functions What are docstrings ?How are they useful? Explain global vs. local variables. Explain anonymous functions. Identify the following function definitions as void or non-void function. How are docstring different from comments? Give the output of the following code:12th Standard CBSE Computer Science Functions Important Questions
Ekta Bhalla - Kottayam Apr-24 , 2021
QB365-Question Bank Software
Functions Important Questions
Reg.No. :
print (type(type(int)))
L = ['a','b','c','d']
print (" ".join(L))
def fun(s):
k=len(s) .
m=""
for i in range(0,k):
if(s[i].isupper()):
m=m+s[i].lower()
elif s[i].isalpha():
m=m+s[i].upper()
else:
m=m+'bb'
print(m)
fun('schooI2@com')
PICKER. import random
PICKER = random.randint (0, 3)
COLOR = ["BLUE","PINK", "GREEN", "RED"]
for I in COLOR:
for J in range (1, PICKER) :
print (I, end = " ")
print ()
(i)
(ii)
(iii)
(iv)
BLUE
BLUE
PINK
BLUEBLUE
PINK
BLUEPINK
PINKGREEN
PINKPINK
GREEN
BLUEPINKGREEN
GREENRED
GREENGREEN
RED
BLUEPINKGREENRED
REDRED
i) 2-ye2y +4y ii) Iex- x2 - xI
import math
from math import *
sinppet and why?
# module calculate.py
''''''This module will be imported"""
defsum 0:
"""Prints sum of 10 and 5"''''
b=5
a=10
print ("sum=",a+b)
return
def diff():
"""prints difference of 20 and 5"""
a=30
b=5
print ("Difference=", a-b)
return
print ("This will print something")
greet= "Hello!"
#Fun.py import calculate print calculate.gra
(i) fun(p=5, t=2)
(ii) fun(c=2, r=7)
(iii) fun (80,p=7,r=2)
1 def increase (x): (b) a=l
2 a= a+x def ft):
3 return a=10
4 print(a)
5 a=20
6 b=5
7 increase (b)
8 print(a)
total=0;
def sum(arg1, arg2) :
total = arg1 + arg2
print("Total:", total)
return total
sum (10,20)
print("Total:" total)
def addEm (x,y,z):
return x+y+z
print(x+y+z)
(a) num=l (Each part carries 2 marks)
def myfunct):
returnnum
print (num)
print (myfunc ())
print (num)
a) Length of box b) width of box c) height of box
def hello():
print ('Hello,',)
def world():
print ('World!')
def minus (total, decrement)
output = total - decrement
return output
import math
import random
print (math. ceil (random.random( )))
1. def describe intelligent life form ():
2. height = input ("Enter the height")
3. raw_input ("Is it correct?")
4. weight = input ("Enter the weight")
5. favourite-game = input ("Enter favorite game")
6. print ("your height", height, 'and weight', weight)
7. print ("and your favourite game is", favouritism, '.')
(i) Asks the user to input a diameter of circle in inches.
(ii) Sets a variable called radius to one half of that number.
(iii)Calculate the area of circle.
(iv) Print the area of circle with appropriate unit.
(v) Return this same amount as the output of the function
Explain.
def f1()}:
n = 44
def f2 ():
n= 77
print ("value of n", n ())
print ("value of n",n)
(i) def fun():
print("Hello!")
(ii) def fun():
print("Hello!")
return(1)
(iii) def fun():
print("Hello!")
retum(1)
(iv) def fun():
return(2)
print("Hello")
def Hello(Sum):
fori in Sum:
print(i)
S=("Hii", "Hello", "Namaste")
Hello(S)
*****************************************
Reviews & Comments about 12th Standard CBSE Computer Science Functions Important Questions
Write your Comment