Showing posts with the label Working With Function

def myFunc(list1, var1): 2. list1[0] += 2 3. var1 += 2 4. print(Values/variables within called function :, list1, var1)

Q. Consider following program code, which is similar to the previous program bu…

1. def myFunc (l, v) 2. l[0] +=2 3. V +=2 4. print(Values/variables within called function :, l , v)

Q. Consider following program code. 1. def myFunc (l, v) 2. l[0] +=2 3. V +…

From program given below, identify the scope of each variable in program.

Q. From the program given below, identify the scope of each variable in the pro…

Given some programs below. Write their flow of execution.

Q. Given some programs below. Write their flow of execution. Program co…

Following code is giving an error at line number 6. Why is this error occurring? What is solution?

Q. Following code is giving an error at line number 6. Why is this error occurr…

What is wrong with following function code? Find reason and correct it.

Q. What is wrong with following function code? Find reason and correct it. def …

For above function, some function calls are being given below. Find errors in these function call statements

Q. Consider following function header def robot (voltage, state = 'a stiff&…

What will be the output produced by above program

Q. What will be the output produced by above program (given in question 1)? Ans…

Identify the types and values of arguments being passed for each function call.

Q. Consider the following code. Identify the types and values of arguments bein…

Define a Python function called absolute that takes one parameter (x)

Q. Define a Python function called absolute that takes one parameter (x) and re…

Consider following function definitions. Write appropriate function call statements for these.

Q. Consider the following function definitions. Write appropriate function call…

1. def lastDigitCube(n) : 2. d = n % 10 3. c = d ** 3 4. return c

Q. Identify the mentioned parts from the code given below. 1. def lastDigitCube…

If you carefully observe function definitions of question1, you find functions sub1() and cube2()

Q. If you carefully observe the function definitions of question1, you'll f…

Carefully go through the following sample code and identify various parts of functions.

Q. Carefully go through the following sample code and identify various parts of…

Find and write output of following python code: def Call(P = 40, Q = 20): P = P + Q

Q. Find and write the output of the following python code: def Call (P = 40, Q …

Write a program that generates 4 terms of an AP by providing initial and step values to

Q. Write a program that generates 4 terms of an AP by providing initial and ste…

Write a function that receives an octal number and prints the equivalent number in other number bases

Q. Write a function that receives an octal number and prints the equivalent num…

Write a function that takes a positive integer and returns the ones position digit of the integer.

Q. Write a function that takes a positive integer and returns the one's pos…

Is return statement optional ? Compare and comment on the following two return statements : return

Q. Is return statement optional ? Compare and comment on the following two retu…

def interest(prnc, time = 2, rate = 0.10) : return (prnc* time * rate)

Q. What will be the output of following code? def interest (prnc, time = 2, rat…

Load More That is All