0% found this document useful (0 votes)
11 views18 pages

Ip CH2

Uploaded by

saiatrey12
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)
11 views18 pages

Ip CH2

Uploaded by

saiatrey12
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/ 18

CHAPTER-2

CHAPTER NAME:
Introduction to Python programming
Weightage : 25 MARKS
QUESTION-1
List out the programming modes supported in Python Softwares.
(or)
List out the execution modes in Python.

• Script mode
• Interactive mode
QUESTION-2
List out any four Softwares/IDE’s where can we run Python codes.

• Spyder Software
• Pycharm Software
• IDLE Software(IDLE-Integrated Development and Learning Environment)
• Jupyter Software
QUESTION-3
List out any 2 Escape Sequences in Python

Escape Sequences Name & Purpose


\n New Line

\n takes cursor to the new line


\t Horizontal Tab

\t provides tab space horizontally on the


current line
QUESTION-4
What are Identifiers? List out the rules for Identifiers. (REMEMBER ANY 2
EASY POINTS)

Identifiers:
Identifiers refer to variable names and function names

Rules to be followed while assigning names for Identifiers:


• Identifiers should begin with either alphabet (or) underscore
• Identifiers should not begin with number
• Identifiers can be formed using::::: alphabets, numbers and underscore. But it should not begin with
number

• Space is not allowed


• Except underscore symbol, no other symbols are allowed
• Keywords should not be used as Identifiers
QUESTION-5
What are Keywords? List out any 4 keywords

Keywords:
are the special words which performs a specific task.
True if try as

False elif except from

None else raise with

is for finally assert

while yield
in
break lambda
not
continue nonlocsl
and
pass return
or
class global
import
def

del

Total:33 keywords
QUESTION-6
List out the valid Identifiers from the following:
Serial_no.
Total_Marks
1st_Room
Hundred$
True
_Avg
Final Result
Sum-1
IMPORT
import

Answer:
Total_Marks, _Avg, IMPORT
QUESTION-7
What are Datatypes? List out any 4 datatypes

Datatypes:
Datatypes are in-built concepts which supports storing of different categories of
data.

Datatypes supported are:


Integer
Float Number datatype
Complex

String
List Sequence datatype
Tuple

Dictionary ------Mapping datatype


For Better Understanding on Datatypes concept, read this slide:

In python program, we can store numbers because of integer datatype)


In python program, we can store decimal numbers because of float datatype)
In python program, we can store complex numbers because of cpmplex datatype)

In python program, we can store names because of string datatype)


QUESTION-8
List out the differences between List and String.

List String

List is used for storing multipe datas String is used for storing a name/message

List should be represented in [ ] String should be represented either in single


(or) double (or) triple quotes

Example: Example:
L=[‘Ram’, ‘Ravi’, ‘John’, ‘Abubakkar’] L=‘Ravi’

A list has been taken to store 4 names


QUESTION-9
List out the differences between Mutable and Immutable datatype.(any 2
points)
Mutable datatype Immutable datatype

Mutable datatype refers to those datatypes whose


values can be changed

Example1: Example1:
List Integer
Dictionary float
String
Tuple

Example2: Example2:
L=[‘Ram’, ‘Ravi’, ‘Raghu’] L=‘Ram’
L[0]=‘Abhishek’ L[0]=‘r’
print(L) print(L)

Answer is [‘Abhishek’, ‘Ravi’, ‘Raghu’] Answer is: Error. Because String doesnot support
modification
QUESTION-10
List out the advantages of Python programming language.
(or)
List out the features of Python programming language.

• Python language is Easy to code

• Python Language is Portable


(i.e A python program written for Windows OS will run on other platforms such as MacOS, UnixOS,
Linux OS)

• Python Language has Large Standard Library


(many libraries are available in python for image processing, artificial intelligence and still for many
applications)
QUESTION-12
List out the disadvantages of Python programming language.

• Memory consumption – it consumes more memory


• Simplicity - Because of its simple syntax, the programmers will
find difficult to code in other languages
QUESTION-13
List out the number datatypes in Python.

• Integer datatype
• Float datatype
• Complex datatype
QUESTION-14
List out the SEQUENCE datatypes in Python.

• String datatype
• List datatype
• Tuple datatype
QUESTION-15
List out the differences between Script and Interactive mode.

Script mode Interactive mode


Script mode is used for typing programs Interactive mode is used to test (or) execute a single
line of code

In Interactive mode, we cannot save the codes


QUESTION-16
Python is Free and Open source. Why?

Python is Free because Python is available for use at free of cost

Python is OpenSource because its source code is available on the internet.


(So anyone can modify and publish their own version)

You might also like