Page 1 :
SANSKAR GLOBAL SCHOOL, Teunga, Pratapgarh(U.P.), , Subject- Computer, Session-(2020-21), th, , Class-7, , Chapter 8- INTRODUCTION TO PYTHON LANGUAGE, Note: - Copy Ques-Ans to your fair copy. Do exercise in your book., , EXERCISE, A. Tick (✓) the correct answer., 1. Who created Python in late 1980s?, Ans. B, a) Guido von Rosum b) Guido van Rossum c) Monty Python, 2. The primary prompt in Python is__________., a) >>>, b) >>, c) >=, , Ans. A, , 3. Python is processed at run time by a __________., a) Compiler, b) Assembler, c) Interpreter, , Ans. C, , 4. __________ is the grammar of a programming language., a) Syntax, b) Syntax Error, c) Virus, , Ans. B, , 5. Syntax Error is also known as _______________., a) Worm, b) Virus, c) Bug, , Ans. C, , B. Fill in the blanks:1., 2., 3., 4., 5., , In Python, you can save program in script mode., Python files have .py extension., Print function is used to display the specified content on the screen., Comments start with # sign., F5 is the shortcut key to run a program.
Page 2 :
C. Write True (T) or False (F)., 1. Python is a case sensitive language., Ans. True, 2. In Python, anything written after # is printed as it is. Ans. False, 3. You need to pay to use the Python software., Ans. False, 4. Python uses (\) character to denote that a line should continue. Ans. True, 5. You can save program in the Interactive mode of Python IDLE. Ans. False, D. Short answer type questions., Q1. Who was the developer of Python?, Ans1. Python is a general purpose interpreted language developed by Guido, van Rossum., Q2. Write the full form of IDLE., Ans2. IDLE is an acronym of Integrated Development Environment., Q3. Which function is used to display result on the screen in Python?, Ans3. Print function displays the result., E. Long answer type questions., Q1. Differentiate between interactive and script mode in Python., Ans1. Interactive Mode, as the name suggests, allows to interact with OS. It is, convenient for the beginners to work and for testing codes., Script mode is used to create and edit Python source file. This mode is, used for coding more than few lines, so as to save the code, modify and, reuse it., Q2. What is Print ( ) function? Write its syntax., Ans2. Print() function evaluates the expression before printing it on the, monitor. It is a function, which is used to display the specified content, on the screen. Print statement outputs an entire line and then goes to, next line for subsequent output (s)., Syntax: print (expression/constant/variable), Q3. Write any three features that make Python a popular programming, language.
Page 3 :
Ans3. i) Python is an object oriented language., ii) It allows editing and running program from a single interface., iii) Interactive environment makes it easy to write program., Q4. How are comments written in a program in Python?, Ans4. In Python, comment start with ‘#’ (hash) symbol. Anything written, after # in a line is ignored by interpreter, i.e. A comment can appear on, a line by itself or it can also be at the end of line., For example: print (25*17) #Multiplication operator, F. Find the error in the following commands., 1. >>> print 20 + 40, Ans. Error: Parenthesis missing, 2. >>> PRINT (“Hello”), Ans. Error: print has to be written in small letters., 3. >>> print (good morning), Ans. Error: String should be in quote., G. Application based questions., Q1. Yukti wanted to print the quotient of 177 / 7 using Python. Write the, command which she should type in Python for this task., Ans1. print (177/ 77), Q2. Mehak is using Python language for the first time. She wants to save the, source file, so that she can edit it later. Which mode should she use to, solve this purpose?, Ans2. Script Mode.