Chapter 3: Brief overview of Python



NCERT solutions Brief overview of Python


1. Which of the following identifier names are invalid and why?
a) Serial_no.         e) Total_Marks
b) 1st_Room         f) total-Marks
c) Hundred$         g) _Percentage
d) Total Marks       h) True

a) Serial_no.:Invalid, reason –> dot symbol is used which is not allowed to use in identifier names
b) 1st_Room: Invalid, reason –> Starting with a number
c) Hunderd$: Invalid, $ cannot be used in variable name
d) Total Marks: Invalid, space in not in identifier names
f) total-Marks: Invalid, – (dash) is not allowed
h) True: Invalid, True is a keyword


2. Write the corresponding Python assignment statements:
a) Assign 10 to variable length and 20 to variable breadth.

length=10
breadth=20 


b) Assign the average of values of variables length and breadth to a variable sum.

sum = (length + breadth) / 2


c) Assign a list containing strings ‘Paper’, ‘Gel Pen’, and ‘Eraser’ to a variable stationery.

stationery = [‘Paper’, ‘Gel Pen’, ‘Eraser’]


d) Assign the strings ‘Mohandas’, ‘Karamchand’, and ‘Gandhi’ to variables first, middle and last.

first , middle , last   = ‘Mohandas’ , ‘Karamchand’ ,’Gandhi’   


e) Assign the concatenated value of string variables first, middle and last to variable fullname. Make sure to incorporate blank spaces appropriately between different parts of names.

fullname = first + ” ” + middle + ” ” + last


3. Which data type will be used to represent the following data values and why?
a)  Number of months in a year 

Integer Number as it is the number of months


b) Resident of Delhi or not

Boolean – True or False as only two values are there either yes or no


c) Mobile number 

Integer Number, mobile doesn’t have decimal points


d) Pocket money

Float Number, it can be with fractional values


e) Volume of a sphere

Float Number can hold fractional values


f) Perimeter of a square

Float Number can hold decimal places


g) Name of the student

String, as a set of alphabets


h) Address of the student

String, Combination of letters and numbers


4. Give the output of the following when num1 = 4, num2 =3, num3 = 2
a) num1 += num2 + num3

No output


b) print (num1)

The output is 9


c) num1 = num1 ** (num2 + num3)

No output


d) print (num1)

The output will be: 1024


e) num1 **= num2 + c

It will raise an error as c is not defined. 


f) num1 = ‘5’ + ‘5’

No output


g) print(num1)

The output will be 55.


h) print(4.00/(2.0+2.0))

The output will be 1.


i) num1 = 2+9*((3*12)-8)/10

No output


j) print(num1)

First it will execute 3*12 = 36. Now the statement will be like this:
num1 = 2 + 9*(36-8)/10
Now it will execute 36-8 = 28. Again the statement will looks something like this:
num1 = 2 + 9*28/10
Then it will execute 28/10 = 2.8, it will look like this:
num1 = 2 + 9 * 2.8
Then it will execute 9 * 2.8 = 25.2, and finally
num1 = 2 + 25.2 = 27.2


k) num1 = float(10)

No output


l) print (num1)

The output will be 10.0


m) num1 = int(‘3.14’)

Error in statement. Invalid Literal as it cannot be passed string to int function.


n) print (num1)

No output


o) print(10 != 9 and 20 >= 20)

True as condition is true.


p) print(5 % 10 + 10 < 50 and 29 <= 29)

True as condition is true.


NCERT solutions Brief overview of Python



5. Categorise the following as syntax error, logical error or runtime error:
a) 25 / 0
b) num1 = 25; num2 = 0; num1/num2

In both statements, ZeroDivsionError:division by zero is there. This is error is runt time error.


6. Write a Python program to calculate the amount payable if money has been lent on simple interest. Principal or money lent = P, Rate = R% per annum and Time = T years. Then Simple Interest (SI) = (P x R x T)/ 100.Amount payable = Principal + SI. P, R and T are given as input to the program.

p = int(input(“Enter the principal amount:”))
r = float(input(“Enter rate of interest:”))
t = int(input(“Enter the Time duration:”))
si = (p*r*t)/100
amt_pay = p + si
print(“The payable amount is:”,amt_pay)


7. Write a program to repeat the string ‘‘GOOD MORNING”  n times. Here n is an integer entered by the user.

n = int(input(“Enter value to repeat /’Good Morning/'”))
for i in range(n):
   print(“Good Morning”)


8. Write a program to find the average of 3 numbers.

n1,n2,n3= int(input()) , int(input()) , int(input())
print( (n1+n2+n3)/3)


9. Write a program that asks the user to enter one’s name and age. Print out a message addressed to the user that tells the user the year in which he/she will turn 100 years old.

name = input(‘Enter your name’)
age = int(input(‘Enter your present age’))
age100 = 2021 + (100 – age)
print(name, “you will turn 100 years old in the year ” , age100 )


10. What is the difference between else and elif construct  of if statement?

The else construct will check at the end of all statements and is the last case of if-elif-else portion, where elif checked when the top if or elif evaluates false.
Else block doesn’t require any condition, elif requires a condition.


11. Find the output of the following program segments:
a)  for i in range(20,30,2):
         print(i)

The output will be:
20
22
24
26
28


b) country = ‘INDIA’
    for i in country:
        print (i)

The output will be:
I
N
D
I
A


c) i = 0; sum = 0
    while i < 9:
            if i % 4 == 0:
                sum = sum + i
            i = i + 2
    print (sum) 

The output is 12.



NCERT solutions Brief overview of Python


NCERT Class 11 Solutions can be of great value if you are trying to excel in your school examinations. The journey starts directly from when you step into class 1 as every class holds great to use as you progress. CBSE Class 11 is no doubt a very valuable class and the last class of your school life. Not to mention, it also leads to a lot of career-making decisions as you seem for some important competitive exams to get your desire college. NCERT solution can help you immensely throughout this adventure of yours.

NCERT Class 11 Solutions

Although higher classes students like Class 10-12 should have a better knowledge of all the topics that will help them to examine deeper into the basics as well as an advanced level of questions that are asked in many competitive exams after 12 class. One of the best ways to achieve it is by answering questions of NCERT Books with the help of NCERT solutions. We at SelfStudys strive hard to devise better ideas in order to help students and give you detailed solutions for all questions from the NCERT textbook as per the latest CBSE CCE marking scheme pattern is to back you up in useful learning in all the exams conducted by CBSE curriculum. The plethora of advantages of referring to NCERT solutions requires an in-depth understanding of detailed solutions of all NCERT book’s questions.


We have given all the detailed NCERT questions and solutions in PDF format which you can read for FREE. All you have to do is download the SelfStudys NCERT Solutions for Class 11 once for FREE and you are able to go. You can get all the Subject NCERT solutions by the links provided here. NCERT Solutions for all the subjects of Class 11 is available on this page including NCERT Class 11 Solution for Maths, Chemistry, Physics, English, Business Studies, Biology, economics are provided below to download in a free PDF file.



NCERT Solution for Class 11

NCERT Class 11 Solutions to the questions with Chapter-wise, detailed are given with the objective of helping students compare their answers with the example. NCERT books provide a strong foundation for every chapter. They ensure a smooth and easy knowledge of advanced concepts. As suggested by the HRD ministry, they will perform a major role in JEE.



NCERT Class 11 Solutions | NCERT Solution for Class 11

NCERT Solution for Class 11 includes all the questions given in NCERT Books for all Subjects. Here all questions are solved with detailed information and available for free to check. NCERT Solutions for Class 11 are given here for all chapter-wise. Select the subject and choose a chapter to view NCERT Solution chapter-wise. We hope that our NCERT Class 11 Solutions helped with your studies! If you liked our NCERT Solutions for Class 11, please share this post.



Why NCERT Solutions for Class 11 is Important?

NCERT Class 11 Solutions increases the base for conceptual knowledge. It provides a complete view of the prescribed syllabus, as the textbook doesn't have a detailed description of the syllabus nor solutions. All the important theorems and formulas of Class 11 are completely solved, which works to make the concepts and find new links to them. Importantly, the NCERT Class 11 Solutions is the point of reference for those students planning for competitive examinations such as NRRT, JEE Main/Advanced, BITSAT & VITEEE, etc. When the NCERT book is accompanied by the solutions, the knowledge of concepts becomes simple and in-depth. Moreover, students can trail into the solutions without break in topics, as it is designed to give a step-by-step explanation. Try out the Class 11 Solutions and learn from the resources.



Why try NCERT Class 11 Solutions?

Well, here are the solid reasons why you should and must try out the NCERT Class 11 Solutions.

Has ERRORLESS answers with 100% Reasoning

The quality of solutions is perfect

Gives in-depth knowledge with notes shortly after the solutions with shortcuts, tips, alternative methods & points to remember

Gives quick revision of the concepts included along with important definitions and Formulas on the chapters, which acts as a prepared refresher.

Designed step-by-step to give 100% Concept Clearness



No comments:

Post a Comment

Have query? Just say it.