Important QnA Python Fundamentals Class 11

In this article, we are going to discuss some important QnA Python Fundamentals Class 11. You can read notes for the same topic from here. Click here.

Important QnA Python Fundamentals Class 11

Let’s start the article important QnA Python Fundamentals Class 11 with some theory questions. 

Theory Questions

Q – 1 What are the important parts of a program?
Answer: A python program has the following important parts:
    1. Function Header
    2. Statements
    3. Expressions
    4. Tokens
    5. Function call
    6. Comments

Q – 2 Identfy variable or identifier, operator and value in a = 5 statement.

Answer: In a = 5, statement a is a variable or identifier, = is operator and 5  is value.
 
Q – 3 What do you mean by address, value and data type? How to print the address, value, and data type of a variable in a python program?
 
Q – 4 Draw a diagram of primary data types available in python.
 
Q – 5 Explain the primary data types available in Python.
 
Q – 6 What is a variable?
 
Q – 7 Explain variable assignment in detail with multiple assignment statements.
 
Q – 8 How to use input() function and print() function? Explain n detail.  
 
Q – 9 What is typecasting? Explain with example.
 
Follow this link to find the answers:
 
Read Python documentation for inbuilt python function.
 
In the next section of important QnA Python Fundamentals Class 11 we will discuss some applications-based questions. 

Application-based Questions

In the first section application-based questions for important QnA Python Fundamentals Class 11 let’s discuss python basics questions. 

Q – 1 Which of the following are invalid identifiers? 
mynum, 1tab, stu roll no, for1, for, While, while
Ans.: 1tab → Starts with a number, stu roll no → space is given in the variable name, for and while are keywords
 
The next section contains for important QnA Python Fundamentals Class 11 contains error based questions. 
 
Q – 2 Find errors in the following code:
 
i) stu_marks = 90
print(Students Score stu_marks)
 
Ans.: There is error in line 2. The print() function accepts only variable without function if the user needs to print any custom message, the message text should be enclosed in double-quotes. So correct statement is anyone these:
print(stu_marks)
print(“Students Score:”, stu_marks)
 
ii) a = 30, b = 40
print(a;b)
Ans.: There is an error in line 1. Python doesn’t allow to assign multiple variables like this. If its required it can be done either one of these ways:
a,b = 30, 40
 
a = 30
b = 40
 
There is an error in line 2 as well. To separate values of the variable in print, user can use, (comma) not a semicolon, hence the correct code is like this:
print(a,b)
 
iii) stu_name (input=”Enter name of student:”)
      print(“Student Name:”,Stu_name)
Ans.: There is error in line 1. When input() function is used in the expression, in must come after =. Here the correction is like this:
stu_name = input(“Enter name of student:”)
 
iv)  x, y = 30, 7
      z = (int) x/y
Ans.: There is an error in the typecasting statement. In python, the statement where type casting is required is written as a parameter in a specific data type function. 
 
The next section have some output finding questions for QnA Python Fundamentals Class 11, 
Q – 3 Find the output:
(i) a = 3
     print(a+a)
Output:6
 
(ii) a = 5
      b = a
      c = b – 3
      print(a,b,c)
Ouptut: 5 5 2
 
(iii) cname = “Subodh”
       bill_amount=1500
       print(“Customer Name & Bill:”,cname+1500)
Output:No output due to Error, cname is string and bill_amount is integer
 
(iv) a = 55
      b = a + 4
      a = 30, b + 2
      print(b, a)
Ouptut: 59 (30,61) . Initially, the value of a is 55, the value of b is 55 + 4 = 59, in third line the value of a is gain changed as mentions 30, 59 + 2= (30, 61). So in print function first value of b is printed, then a is printed Hence ouptut is 59 (30,61)
 
(v) a, b  = 10, 30
      a, b, a = b, b + 3, a – 5
     print( a, b) 
Ouptut: The value of a and b is 10 and 30 respectively. After that, in next line the value of b is assigned to a i.e 30 then b + 3 = 30 + 3 = 33 assigned to b and finally a -5 = 10 – 5 = 5 assigned to a. So output will be 5 33. 
 
(vi) a, b = 10 , 5
      print(type(print(a+b)))
Ouptut: 15
             <class ‘NoneType’>. As print() function is nested in the code gives None output for the outer print() function. type() function returns the final data type of the value. 
 
Thank you for reading this article. 

Leave a Reply