Posts

Showing posts with the label class 12

Q 7 jrgeshestm teejthjkljklh srthklkltjsjkghsegbn tjhrhrthgkjerjklhbgebgjasb nerjks

P.I.P: - 7.1     Q1. Consider the following code: what is the value of ‘a’ at the end?   a = [1, 2, 3] a [2] = 0 a [a [ 2 ] ] = 5 a [1:2] = []   Answer =   Value of ‘a’ at the end is: [5, 0]               Q2. You have a list a = [1, 2, [3, 4], 5]. Now answer the following. Verify your answers in Python Shell.   (a) What is the length of a? 4 (b) How many elements does it contain? What are their types? It contain 4 element. 3 integer type & 1 list. (c) How many integers? 3 integer (d) What does len(a[2]) return? 2 (e) What does a[len(a)] evaluate to? It give error. (f) What does a [-1 * len(a)] evaluate to? Output:- 1               Q4. Giv...

Q4

  P.I.P: - 3.2     Q8. Predict the output of following code:   num = 20.5 z = 3 result = 2 + z * z ** 3 + num // z print (result)   (a) Firstly, determine the answer without running the code and write. (b) Now type the above code in script mode and test-run the program. Write below the result given by Python.   Answer =   (i) It is based on your thinking that how you execute the above program in your mind. So do you self.   (ii) Output:-   89.0 >>>              Q9. Write a program to read a floating point number n. Print n, n 2 , n 3 , n 4 and n 5 .   Answer =   num = float (input ("Enter the number :- ")) print ("Answer is :- ", num, ', ', num **2, ', ', num ** 3, ', ', num ** 4, ' &', num ** 5)             Q10. Write a program that calculates the volume and surface area ...