## Python Programming Fundamentals Preeti Arora Class 11 IP Solution || Python Programming Fundamentals Class 11 Solution || Python Programming Fundamentals Class 11 IP Solution || Python Programming Fundamentals Information Practices Solution || Preeti Arora Python Programming Fundamentals Solution || Python Programming Fundamentals Class 11 IP || Python Programming Fundamentals Solution

**Note :- Please Click on Question to Answer of that Question !!!**

Q1. Write Python command/instruction/statement to display your name.

Q2. Write Python command to display your school name, class, and section, separated by "-"

Q3. Evaluate the following expressions manually:

(i) (2+3) **3-6/2

(ii) (2 + 3)* 5 // 4 + (4 + 6) / 2

(iii) 12 + (3 * 4 - 6) / 3

(iv) 12 + (3 * 4 - 6) // 2

(v) 12 * 3 % 5 + 2 * 6 // 4

(vi) 12 % 5 * 3 + (2 * 6) // 4

Q4. Evaluate the above expressions by using IDLE as a calculator and verify the results that you get manually.

Q5. Identify invalid variable names from the following, giving reason for each:

Group, if, int, total marks, S.l., volume, tot_strength, #tag, tag$, 9a

Q6. Find the output of the following code:

(a)

x = 3

y = x + 2

x += y

print (x, y)

(b)

x = -2

y = 2

x += y

x -= y

print (x,y)

(c)

a = 5

b = 2*a

a += a + b

b *= a + b

print (a, b)

(d)

p = 10

q = 20

p *= q / 3

q += p + q*2

print (p, q)

(e)

p = 5 % 2

q = p ** 4

r = p//q

p += p + q + r

r += p + q + r

q -= p + q * r

print (p,q,r)

(f)

p = 21//5

q = p % 4

r = p * q

p += p + q - r

r *= p - q + r

q += p + q

print (p, q, r)

Q7. Write Python expressions equivalent to the following arithmetic/algebraic expressions:

(a) a+b/ 2

(b) 32 + 93/ 2

(c) 3² + 93/5

(d) √a + a+2/2

(e) 8 – 6 + 6 * sum /7 - √var

(f) ut + 1/2at2 (u, a, t are variables)

Q8. What are tokens in Python? How many types of tokens are allowed in Python? Exemplify your answer.

Q9. Which argument of print() would you set for:

(a) Changing the default separator (space)?

(b) Printing the following line in current line?

Q10. What do you understand by block/codeblock/suite in Python?

Q11. What is the role of indentation in Python?

Q12. What is the Dynamic Typing feature of Python?

Q13. What would the following code do: X = Y = 7?

Q14. What is the error in the following code: X, Y = 7?

Q15. "Comments are useful and an easy way to enhance readability and ability to understand a program". Elaborate with examples.

Q16. Find the error in the following code fragment:

(a)

Y = x + 5

Print (x, y)

(b) print (x = y = 5)

(c)

a = input ("value")

b = a\2

Print (a, b)

Q17. Write Python expressions to represent the following situations:

(a) Add remainder of 8/3 to the product of 8 and 3.

(b) Find the square root of the sum of 8 and 43.

(c) Find the sum of the square roots of 8 and 43.

(d) Find the integral part of the quotient when 100 is divided by 32.

Q18. What are operators? What is their function? Give examples of some unary and binary operators.

Q19. What is an expression and a statement?

Q20. What all components can a Python program contain?

Q21. What are variables? How are they important for a program?

Q22. What is Dynamic Typing feature in Python?

Q23. Write a function called calculate_area() that takes base and height as input arguments and returns the area of a triangle as output. The formula used is:

Triangle Area = 1 / 2 * base * height

Q24. Modify the above function to take a third parameter called shape type. Shape type should be either triangle or rectangle. Based on the shape, it should calculate the area.

Formula used is: Rectangle Area = length*width

Q25. Write a function that takes amount-in-dollars and dollar-to-rupee conversion price; it then returns the amount converted to rupees.

Q26. What would the following code do?

a = b = 70

Q27. What is the error in the following code?

z, p = 6

Q28. Find out the error(s) in the following code fragments.

(a)

temperature = 90

Print temperature

(b)

a = 30

b = a + b

print (a And b)

(c)

a, b, c = 2, 8, 9

print (a, b, c)

c, b, a + a, b, c

print (a; b; c)

(d)

x = 24

4 = x

(e)

Print ("X=" X)

Q29. What will be the output produced by the following code fragment(s)?

(a)

X = 10

X = X + 10

X = X-5

print (X)

X, Y=X-2, 22

print(X, Y)

(b)

first = 2

second = 3

third = second * first

print (first, second, third)

third = first * second

print (first, second, third)

(c)

side = int(input('side')) #side given as 7

area = side * side

print (side, area)

Q30. What is the problem with the following code fragments?

(a)

a = 3

print (a)

b = 4

print (b).

s = a + b

print (s)

(b)

Name = "Prateek"

Age = 26

Print ("your name & age are", Name + Age)

(c)

A = 3

S = A + 10

A = "New"

Q = A/10

Q31. Give the output.

x = 40

y = x + 1

x = 20, y + x

print (x, y)

Q32. Write the output.

x, y = 20, 60

y, x, y = x, y - 10, x + 10

print (x, y)

Q33. Give the output.

a, b = 12, 13

c, b = a*2, a/2

print (a, b, c)

Q34. Find the output.

a, b, c = 10, 20, 30

p, q, r = c - 5, a + 3, b - 4

print ('a and b, :', p, q, r)

Q35. Find errors in the following code fragment: (The input entered as XI)

c = int (input ("Enter your class"}}

print ("Your class is", c)

Q36. Find the errors in the following code fragment:

cl = input ("Enter your class")

print ("Last year you were in class", cl-1)

Q37. The id() can be used to get the memory address of a variable. Consider the following code and tell if the id() function will return the same value or not (as the value to be printed via print ()). Why? There are four print() function statements that are printing id of variable num below:

num = 13

print (id (num))

num = num + 3

print (id (num))

num = num - 3

print (id (num))

number = "Python"

print (id (number))

Q38. Predict the output of the following code:

days = int (input("Input days: ")) * 3600 * 24

hours = int (input("Input hours: ")) * 3600

minutes = int (input("Input minutes: ")) * 60

seconds = int(input("Input seconds: "))

time = days + hours + minutes + seconds

print("The amounts of seconds", time)

If the input given is in this order: 1, 2, 3, 4

Q39. Write a program that generates the following output:

5

10

9

Assign value 5 to a variable using assignment operator (=) multiply it with 2 to generate 10 and subtract 1 to generate 9.

Q40. Modify the above program so as to print the output as 5@10@9.

Q41. Write a program with maximum three lines of code that assigns first 5 multiples of a number to 5 variables and then prints them.

Q42. Write a program to read a number n and print n², n³, n4.

Q43. Write a program to compute simple interest and compound interest.

Q44. Write a program to input a number and print its first five multiples.

Q45. Write a Python program that accepts radius of a circle and prints its area.

Q46. Write a Python program that accepts marks in 5 subjects and outputs the average marks.

Q47. Write a program to find the area of a triangle.

Q48. Write a program to input a number and print its first five multiples.

Q49. Write a program to read details like name, class, age of a student and then print the details, firstly in the same line and then in separate lines.

Q50. Write a program to read three numbers in three variables and swap the first two variables with the sums of first and second, and second and third numbers respectively.

Good

ReplyDeleteThank you ðŸ˜ŠðŸ˜ŠðŸ’•

DeleteQuestion answer

ReplyDeleteClick on Question to get answers of that question.

DeleteNice...

ReplyDeleteThank you

DeleteWhere is the answer for this ?

ReplyDeletePlease click on question to get answer of that question.

Deletedo new session ques/ans plz 2023

ReplyDeletePlease send me the questions.

Delete## Post a Comment

You can help us by Clicking on ads. ^_^

Please do not send spam comment : )