Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
3 views3 pages

IX - Introduction To Python - Solved Ex.

Uploaded by

deveshsarsenda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

IX - Introduction To Python - Solved Ex.

Uploaded by

deveshsarsenda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

AMARCHAND SINGHVI INTERNATIONAL SCHOOL

CLASS VIII – COMPUTER SCIENCE


CH – 11
SOLVED EXERCISE
Work to be done in textbook
A. Fill in the blanks.
1. The symbol of ‘not equal’ relational operator is != .
2. The output of not(23<=54) is False .
3. The Input() statement is used to receive input from the user.

B. Write T for true statement and F for False one. Correct the False statement(s).
1. Double quotes can be used for multiline strings. True
2. The comment statement starts with “@” character. False
Correct statement: The comment statement starts with “#” character.
3. The print() function is used to get output on the screen. True.
C. Choose the correct option.
1. What will be the output of the following code:
x=5
y=7
x *= y * x + 10
a. 200 b. 215 c. 225 d. 220
2. Which one is an invalid variable?
a. _Num b. Perc% d. Firstname d. salary1
3. What will be the output of the following code?
A = 5.5
B=2
Print(A//B)
a. 2 b. 3 c. 2.0 d. 3.0

Descriptive Type Questions:


Answer the following.
1. What are the two modes to work in python?
Ans: There are two modes to work in python.
Interactive mode: In this mode a command is executed and gives output immediately after typing
it and pressing the enter key.

Class IX Computer Applications


Script mode: In script mode you can write a complete python program that has multiple lines
this can be saved as a program file you can then run the entire program in one go anytime you
want.
2. Which symbol is used for comments in python?
Ans: In python comment starts with # character.
3. How will you run a program in script mode?
Ans: Steps to run a program in script mode are:
1. Click File New file
2. In the new window that opens, type the program.
3. Save the program by clicking File  Save As. The Save As dialog box appears. Type the file
name and click Ok.
4. What is a keyword mention any two keywords in python?
Ans: keywords are reserve words that have a predefined meaning. They are easy to recognise in
ideally because they appear in orange. Some examples are and, del, def etc.
5. What is the difference between ‘\t’ and ‘\n’ (escape sequence characters)?
Ans: \n is the new line character, it moves the cursor to starting of next line.
\t is the horizontal tab character, It moves the cursor a tab width.
6. Why is python a popular programming language mention any four reasons.
Ans: Python is a popular programming language mainly due to the following reasons:
 It has a simple syntax and easy to learn.
 It is an interpreted language and therefore it is easy to debug.
 It is portable that is the code can run on different platforms like windows and LINUX
without any change.
 It is a free and open source language it is freely available for download from the website
http:// www.python.org.
7. What are the rules for naming a python variable?
Ans: Every variable in a program must have a unique name. following are the rules for a variable
in python:
 A variable can be of any length
 It can contain letters digits and or underscore.
 The first character must be a letter or an underscore and must not be a digit.
 Punctuation marks and spaces are not allowed in a variable name.
 Python is a case sensitive language therefore ‘total’, ‘Total and ‘TOTAL” are different
variable names.
 A keyword cannot be used as a variable.
Class IX Computer Applications
8. How will you assign single and multiple strings in python?
Ans: A string type of data (str) refers to a sequence of characters and numbers in single quotes or
double quotes. For multiple strings you can use triple single quotes or triple double quotes.
9. Name the data types available in python. Also mention whether they are mutable and
immutable.
Ans: In python, the data store in memory can be of the following types: Numbers, None,
Sequence, Sets, Mapping, Integers, float.
Data types in python can be mutable or immutable.
 The values in a mutable data type can be changed after they are created.
 The values in an immutable data type cannot be changed without changing their identity.
For a change in value in an immutable data type, a new memory location is allocated.
10. Define Arithmatic Operators.
Ans:
Arithmetic Operators: Arithmetic Operators are binary operators that perform mathematical
calculations.
Operator Meaning
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulus
** Exponent
// Floor division or
integer division

Class IX Computer Applications

You might also like