Chapter #7 – Functions Chapter #7 – Lab Exercises #4 ABC School has allotted unique token IDs from (1 to 600) to all the parents for facilitating a lucky draw on the day of their Annual day function. The winner would receive a special prize. Write a program using Python that helps to automate the […]
NCERT Computer Science Class #11 – Chapter #7 Solutions – Q #10
Chapter #7 – Functions Chapter #7 – Lab Exercises #3 Write a program that has a user defined function to accept the coefficients of a quadratic equation in variables and calculates its determinant. For example : if the coefficients are stored in the variables a,b,c then calculate determinant as b2-4ac. Write the appropriate condition to […]
NCERT Computer Science Class #11 – Chapter #7 Solutions – Q #9
Chapter #7 – Functions Chapter #7 – Lab Exercises #2: Write a program that uses a user defined function that accepts name and gender (as M for Male, F for Female) and prefixes Mr/Ms on the basis of the gender. You can checkout the code from Github here – Lab Exercises – 2 How the […]
NCERT Computer Science Class #11 – Chapter #7 Solutions – Q #8
Chapter #7 – Functions Chapter #7 – Lab Exercises #1 Write a program to check the divisibility of a number by 7 that is passed as a parameter to the user defined function. You can checkout this code from Github here – Lab Exercises – 1 How the Program Works: Example Output If the user […]
NCERT Computer Science Class #11 – Chapter #7 Solutions – Q #7
Chapter #7 – Functions Chapter #7 – Q #7 Does a function always return a value? Explain with an example. Example of a Function Without a Return Value: Consider the following function that prints a message but does not return any value: When you call this function: In this example, the greet function executes the print statement […]
NCERT Computer Science Class #11 – Chapter #7 Solutions – Q #6
Chapter #7 – Functions Chapter #7 – Q #6: Differentiate between following with the help of an example: a) Argument and Parameter Example: b) Global and Local variable. Example: NCERT Computer Science Class 11 Chapter 7 Solutions Q 6
NCERT Computer Science Class #11 – Chapter #7 Solutions – Q #5
Chapter #7 – Functions Chapter #7 – Q #5 Using an example show how a function in Python can return multiple values. You can return multiple values through a tuple: Return multiple values through a function: Swap variables using a tuple: Combining tuples: Function that returns sum and average: NCERT Computer Science Class 11 Chapter […]
NCERT Computer Science Class #11 – Chapter #7 Solutions – Q #4
Chapter #7 – Functions Chapter #7 – Q #4 How is built-in function pow() function different from function math.pow() ? Explain with an example. Differences Between pow() and math.pow() Example: NCERT Computer Science Class 11 Chapter 7 Solutions Q 4
NCERT Computer Science Class #11 – Chapter #7 Solutions – Q #3
Chapter #7 – Functions Chapter #7 – Q #3 Out of random() and randint(), which function should we use to generate random numbers between 1 and 5. Justify. NCERT Computer Science Class 11 Chapter 7 Solutions Q 3
NCERT Computer Science Class #11 – Chapter #7 Solutions – Q #2
Chapter 7 – Functions Classs #11 – Chapter #7 – Q #2: How is math.ceil(89.7) different from math.floor (89.7)? Summary: Function Input Output math.ceil() 89.7 90 math.floor() 89.7 89 NCERT Computer Science Class 11 Chapter 7 Solutions Q 2