0% found this document useful (0 votes)
273 views5 pages

10 TH Computer Answer

Uploaded by

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

10 TH Computer Answer

Uploaded by

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

Introducing Python

A. Fill in the blanks.


1.In the ________ mode ,you cannot write lengthy code.
Interactive
2. Python was created by __________.
Guido van Rossum
3. _______ are used to name variables,methods,and objects.
Identifiers
4. In the interactive mode of python , the instructions are executed _____.
Line-by-line
5.__________ are the smallest units of a python program.
Tokens
6. _________ cannot be used as variable names.
Keywords
B. State True or False.
1. A variable name can consist of letters, digits, and underscore.
True
2. Python is a platform-dependent programming language.
False
3. Interactive mode is beneficial for testing code.
True
4. Values are assigned to variables using assignment operator (=).
True
5. Keywords are the reserved words in python.
True
6. Literals represent values in a program.
True
C. Select the correct option.
1. Which of the following is an application of python programming?
a) Game Development b) Robotics programming
b) AI Application development d) All of these

2. When a new value is stored in a variable, its previous value gets ____.
a) Accepted b) Overwritten
b) Overlapped d) ignored
3. You can assign values to the variables using the ______ operator.
a) String b) Arithmetic
b) Assignment d) Binary
4. Which of the following is a valid variable ?
a) My_variable b) 2nd_variable
b) Variable@3 d) this is a variable
5. In the __________ mode ,code is typed next to the python prompt.
a) Interactive b) script
C) code d) both a and b
6. What are the type pf tokens in python?
a) Keywords b) Identifiers
c) operators d) All of these
7. In python, variables are used to _______
a) Store values b) Assign values to keywords
c) Execute statements c) None of these
D. Answer the following.
1. What is python?
Ans: Python is simple programming language used to write codes for
the computer programs.
2. Name the literal used for defining decimal numbers.
Ans: The literal used for defining decimal numbers is numeric literal.
3. Name the mode in which instructions are executed line by line ?
Ans: The mode in which instructions are executed line by line is called
the interactive mode.
4. Which type of literal is used to represent the logical values?
Ans: The type of literal used to represent logical values in python is
the Boolean literal.
5. Name the mode used to create and edit python programs.
Ans: The mode used to create and edit python programs is called the
script mode.
E. Answer the following questions.
Write any two features of python language.
1. Some of the key features which make python so popular are:
 It is an easy to learn, general-purpose programming language.
 It is a platform independent programming language, which means
it can be used on any machine and on any operating system.
 It has a simple structure, a few keywords, and a dearly defined
syntax.
 It is a case-sensitive language.
2.What is variable ? Mention any two rules for naming variables
A variable is a named memory location that stores data, whose
value may change during program execution. A variable can store only
one data value at a time, when a new value is stored, its previous
value gets overwritten. There are specific rules in python which have
to be followed to form valid variable names. The rules to write
variable names are :
 A variable name must start with a letter (Uppercase or lowercase)
or an underscore (_).
 A variable name can consist of letters ,digits and underscore. No
other character is allowed.
3.Distinguish between the interactive and script modes.
There are two modes in python:
 Interactive mode: In the interactive mode of python, instructions are
executed line by line, giving th output. In this mode, the commands are
typed next to the python command prompt (>>>) .Interactive mode is
preferred for small programs, where only few commands are to be
executed .
 Script mode: Script mode is used for writing lengthy programs in python .
Using this mode ,we can create and edit python programs ,and save our
file so that it can be used later .
4. What are identifiers in python
Identifier – Identifiers are the fundamental building blocks of a program.
These are used to name different components of a program, such as
variables, methods and objects.
5.What are tokens in python?
All the characters in python program are grouped into symbols called
Tokens . A computer program consists of set of instructions called
statement . A statement is composed of various components . Each
component of a programming statement is referred to as a token .
Three tokens in python are :
i. Keywords
ii. Identifier
iii. Literal
6. What is the difference between a keyword and an identifier?
Keywords are words that have a special meaning to the python
interpreter. Python interpreter reserves these keywords for its own
use, and hence ,these are not available as names for variables and
functions . Keywords are also known as reserved words . Some of the
python keywords are : False,True,class,is, return,None,continue etc. .
Identifiers are the fundamental building blocks of a program. These
are used to name different components of a program , such as
variables, objects and methods .Identifiers are defined by python
programmers .
Example: customerName, $Math,student3,First_name etc.
7. What are literals? Name the different types of literals available in
python.
Literals are the sequence of characters that are stored in variables
and represent values in a program. Literals consist of digits, letters and
other characters. Python supports the following literals:
i. String literals : - When one or more characters are enclosed in
single quotes , double quotes or triple quotes ,the literal is known
as a string literal. Example : ‘abc’,”z+s”,’D’
ii. Boolean literals : - The logical values, ‘True’ and ‘False’ are the
Boolean literals.
iii. Special literals : - In python there is a special literals called None.
The No operator in python has the same significance as the Null
operator used in other programming languages.
iv. Numeric literals : - In python the numeric literals are :
1. Integer literals : - Integer literals represents only whole
numbers. These can either positive or negative .
2. Float literals : - Float literals represents decimal numbers .
These can be written either in fractional or exponential form .
3. Complex literals : - A complex number is created
8. What is the use of print() function? Explain with the help of
example.
The print() function is used to display the output of any command
on the screen . It can also be used to print specified messages.
Example: print(“Hello World”)

You might also like