0% found this document useful (0 votes)
111 views

Iot Unit 3 Decode

Python is an object-oriented, high-level and interpreted programming language. It supports modules and packages which allows for modular programming and code reuse. Python can be used for a variety of tasks like web development, data processing, scientific computing, and more. It runs on many platforms without changes to code. Python uses dynamic typing and garbage collection.
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)
111 views

Iot Unit 3 Decode

Python is an object-oriented, high-level and interpreted programming language. It supports modules and packages which allows for modular programming and code reuse. Python can be used for a variety of tasks like web development, data processing, scientific computing, and more. It runs on many platforms without changes to code. Python uses dynamic typing and garbage collection.
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/ 5

IUNIT• Ill I

'

. Introduction to Python

~-1 : Introduction to Python I • Python supports the use of modules and packages,
which means that programs can be designed in a
1 WJaat .. P,tbon ? modular style and code can be reused across a
Q. • Python is an object - oriented, high - level
variety of ·projects.
~ ~age with integrated dynamic
,einantic:s primarily for web and app development. • Python can also be used to process text, display
· numbers or images, solve scientific equations, and
Q.2 u,t and aplaln featma of Python. save data.
AJ1J- : Featmes : • Python is an interpreted language i.e. interpreter
1. Python is a simple and_minimalistic language.
2. Easy to Leam.
. .
executes the code line by line at a time.
• Due to its open- source nature, Python has been
3. Free and Open Source. ported to many platforms. .All your Python
4. Python supports procedure - oriented programs can work on any of these platforms
programming as well as object- oriented without requiring any changes at all if you are
programming. careful enough to avoid any system - dependent
5. Extensive Libraries : The Python Standard features.
Library is huge indeed. • ~ou can use Python on GNU/Llnux, Windows,
6. Embeddable : You can embed Python within FreeBSD, Macintosh, Solaris.
your CIC++ programs to give scripting • Python uses garbage colledion, the ~ e r
r,
capabilities for your program's users. . doesn't have to worry about memory leaks (failure
Q.3 List the beneflu of Python. to delete) or dangling references.
Ans. : • Python can be used to develop prototypes. · • The Python language environment is reasonably
• Python allows for a more productive coding secure from tampering. Pre- compiled python
environment than massive languages like C# and modules can be distributed to prevent altering the
source code.
Java.
• Python powers Django, a complete and open source Features of Python :
web application framework. 1. Cross-platform language
• Most automation, data mining, and big data 2. Python is a open source programming language
platforms rely on Python. 3. Object - Oriented langpage
• Python supports modules and packages, which 4. Extensive Libraries
encourages program modularity and code reuse.
5. Python provides interface to all commercial
Q.4 Write ehort note on Python. databases.
Ans. : • Python is an object - oriented, high - level
rogramming language. Python is a simple and
alistic language.
(3 - 1)
,,,_ , of'11dl«r

/ 3.2 : Data Types, Data Stru


ctur es /
3-2
_
• It can have any num ber of item
s (inte ger, float
Intro,1,...,
------=::.-.~~
s and th ~
, strin g etc.i,
~ be.
to !'YI!. 1tltlff!!!.O/Tltlnp
::--- --
• The keys in a dictionary mus t
like strin gs or num bers . They
be Imm
mus t ~tab le objects
3-3

If - •llll!'Nalon :
,
I

Q.S Dac rlbe Pydi oa clafa t,pa


.
of diffe rent
# emp ty list
my_list = 11
type
within a dictionar y be unique

e container
....
Body of If
:

: • Pyth on data type s are as follows : • Python dictionary is an 8SSOCiativ Body of alae
An,. r O:.h ich
1. Num bers : it stores num
eric valu e. In Pyth on # list of Integers permits access base d on a key, rathe an • The ii.,eJse statement evaluates test expression and
have integ er mdex. will
body of ii only when test cond
ition .
prog ramm ing lang uage, we my_list "' (1, 2, 3) Tirue.execute is
poin t num bers , and complex t, a dicti
numbers, float ing • A dictionary is a muta ble objec 50
# list with mixe d data type s anot her dicti onary objectonary .
num bers. cann ot use itseU or • U the condition is False, body of else is executed
eric objects : = (1, 'Hello', 3.4) y may be any v~: Inde n s. .
• Pyth on supp orts four type s of num my_list key. A valu e with in a dictionar . tation is used to separate the block
Jong integ ers, float ing poin t num bers , and , imm utab le or muta ble· .
c. For : The for loop in Python
integ ers, of .._P ie. Pyth on type is used
complex num bers. Q.8 Deecrlbe D~ and tupl e In tam e ies : over a
to iterate
exam ple : . • To create Pyth on dicti onar string) or other
2. Strings : it is list of characte
rs in orde r. Strin g Ans. : List and tupl e prog ram iterable ~ (list,_ tuple ,
.
emp ty string. # Mate 8 llat #l/u8 r/bln /pyth on3 -,.,.. .... Iterating over a sequence 19
with zero characters is calle d an my_list = (1, 2. 3, 4, 6, 6, 7)
called trave rsal .
gene ral mec hani sm for (1, 2, 3, 4, 6, 6, 7) # 11,fua 8 tu; la # crea te_d lct.p y
3. Lists : Lists prov ide a my_tuple-=
inde xed by a # Print tbe !lat • Syntax of for Loop.
stori ng a collection of objects print('The list: ', my_list) ': 'Mo nday '}
on. To crea te an emp ty list, use # Print tbe tuple wee kend = { 'Sun ': "Sumiay', 'Mon for Val In aeq ue,- :
num ber in pyth prin t('lb e tupl e 1, my:-tup le)
squa re brackets with no elem ents in betw een
ent In the list :', my_list(Oi) - val8 • dict( one = 1, -two = 2) Body of for
prlnt('The first elem
the a1u ·
them(□). #A cce aaa ne~ • Here, val is the variable that takes v e of the
h like lists, exce pt capJtal& • {} item insid"
4. Tuples : Tupl es are veey muc prlnt('The first elem ent In the tupl e:', my_tuple(OI) _· e the sequence on each iteration.
renc e. capltal8['svk'J • 'Bratl&lava'
# Acc ess 11D ~ismant
for one impo rtan t diffe
t.
its elem ents can' t be :', end =·• ') capltalllj"deu'J = "Beilin' Q.11 WiHa •boat bnal r/co atma a atatamen
• Onc e a tupl e is created, print('All the elem ents in the list . be used in eith
that a tupl e is caplt al8l' dnk'J • 'Copenhagen• Ana. : • The continue statement can to
mod ified in plac e. Kno wing for elem in my_list : s to instruct pyth . er
le, pyth on can be mor e efficient in a !lat for or while loop. on continue on
imm utab # Itera te over the elem ents of to the .
d • { i: object() for t in range(4)
} executing the
man ipul ating tupl es than lists. next iteration of the loop without
prlnt{elem, end ='') follow the contin
• Like lists; the cont ents of tupl
es are arbit rary . The statements in the loop which ~
renc e is that lists are muta ble and tupl es prin t() print (wee kend ) state men t
only diffe e:\ end ='')
prlnt('All the elem ents in the tupl prlnt{vals) the loop variable is
are not.
tuple : • ~ a for loop, the value of
are very simi lar to for elem in my_ print{capitala} . after a cont inue state ment, so that after
5. Dictionaries : Dictionaries a tuple mcre men ted
trary objects and # Iterate over the elem ents of print(d) the loop for the
lists in that they can cont ain arbi skip ping the rema ining part of
h, but, inste ad , print(elem, end= ' ') in four different . itera tion will be
can be nest ed to any desi red dept • In the example, four dictionaries current itera tion, the · next
by integ ers,· they can be ,II prin t() Later we prin t the cont ents of these performed in the normal fashion.
of bein g inde xed ct, such as strin gs # Slice a list way s.
inde xed by any imm utab le obje print('List slice:', my_llst(2:6I) dicti onar ies to the console. be used as an
or tuple s. ) # Slice a tuple • Often a continue statement can
prln t(Tu ple slice:', my_tuple(2:6I "Mon•: "Mo nday •} e a loop, and it's
the first elem ent in the llst . . •') · weellend .= { "Sun•: "Sun day• , ~tem ative to an if statement insid
/ prlnt{'Try to mod lfy renc e as to which one
between Um and tuplea. "1st a matter of personal prefe
Q.e &plaJa cllfference
Ans. : • Lists are deno ted by
square brac kets , i
I
lllY_list(OJ = 9
print('The list:', my_llst)
# Mod tbe list
ify"
[3.3 :Control of Flow / is used.
pare nthe ses. to find the largest
whe reas tupl es are deno ted by • For example, suppose we wish
of foU ~ control of a- :
ent in the llst . . ,'),1
• .lists are mut able whe reas tupl
es are imm utab le. 1' prlnt{'Try to modify Uie first elem
,
Q.10 :-i:;a1a IYDb.tuIf........ c. for number in an array , as well as the index within the
rred.
I' my_tuple[O) = 9 . array at which the largest v$e
occu
after its crea tion # Is tupl e modlflcation possible?
• .list can be chan ged or mod ified can' t be chan ged Ans. : a. H : Pyth on if Stat eme nt Synt
ax
we could use the
acco rdin g to need s . whe reas tupl e
print('The tupl e:', my_tuple)
' • Using a continue statement,
or mod ified afte r its crea tion.
lfta etup reu 1on : following:

I -~
tion than that of tupl e.
Q tlon u,. · , •tat.ment(a)
• Lists has mor e buil t - in func Write abort note on Python clJc » X • (7, 12, 92,, 19, 18 ,44, 31)
test expression and will
size than that of list, aine r of key-value • The prog ram .eva luate s the » xmax • x(OJ
• Tup les oper atio n has smar.ller Ans. : • Pyth on dict iona ry is a cont

I the text expres.1ion is


,
which mak es it a bit faste
pair s. It is mut able and can cont ain mixed ~ -.,
, ,., exec ute state men t(s) only if >>i maz = 0
n is False, the statement(s) > > for t In range(l,len(x)):
:rue . U the text expr essio
Q.7 How to aut e ~U n? ed col l~o n. Python If x(I) < = lllDU : continue
g, a list is crea ted by , •:cti dict io~a ry .is an ~or der IS not exec ute.
AN .:• In Pyth on prog ram min onan es are calle d asso ciati ve arra ys 01 . J,ash
ents ) insid e a square 1 ·" b. if. •..else : Synt ax of if...else
plad ng all the item s (elem table s in othe r lang uage s.
bracket { L sepa rate d by com mas .
T' TECHNICAL PUBUCA TIONS, ._ An up thnl&t for knowledge

T" TECHNICAL PUBLICATIONS, ._ An up tlvu&I for knowled(/e


1 ~ _o/Tlllng, 3•5
~ 'Tlt ~ ---------- --
!!!!~o'[_,f~ffll'
,,.~,-., · -···-·~__:.! ...- Q-.1-5- U-•1-ng
- Pyth --
- -o-n- fun -n
c-o m
- o-n-, -
ctl -~~!:.~
_ptro_ut_:uctt ~-:a.Package: ·- - - - - - - ----...!~~~~to!_ ~~~
1 -•:Example:
xmu • •111 common factor of two Int.gen. • In Python, packages are hierarchical file structure. It
containS modules and subpackages. cla1 Example :
IDlU • I Ans.:
def gcd(n1, n2) : • The package is organized into a root directory with def _lnlt_(aelf, a. b):
.... __._um value was %d at position %d.' % self.a= a
>>print - # Determine the smaller of n1 1111d 112. sub • directories. aelf.b =b
(:IIIIU, IIDU) min = n1 If n1 < n2 else n2
• Packages are namespaces which contain multiple def add{aelf):
Maximum value was 92 at position 2 · # 1 definitely Is a common factor to an lnta mum ■elf.a + ■elf.b
packages and modules themselves. They are simply
Q.12 Eiq,laln .,._ etatament with aample. largest_factor = 1 directOries.
for i in range(1, min + 1): e .. Exampla(B, 6)
Ana. : • Python has a special statement, pass, . that • Each package in Python is a directory which MUST
lfn1 % i == O and n2 % i =.., 0: contain a special file called _init_.py. This file can prtnt(e.addO)
means do nothing. .
largest_factor = i • To create· a class, we use the class statement Class
• We can make the above code fragment legal by be empty, and it indicates that the - directory it
· # Found larger factot
containS is a Python package, so it can be imported names usually start with a capital.
adding a pass statement : retum largest_factor the same way a module can be imported. • Most classes will have a method called _jnit_.
lf:1 < 0 : # Exercise the gcd function
# Do nothing The underscores indicate that it is a special kind of
pas■ num1 = int(input('Pleue enter an integer: 1) • U we create a directory called foo, which marks the·
package name, we can then create a module inside method. It is called a constructor, and it is
else: num2 = int(input('Pleue enter another integer:.')) automatically called when someone creates a new
print(:1) . # Determine the smaller of num1 and num2 that package called bar. We also must not forget to
add the _init_.py file inside the foo directory. object from your class. The constructor is usually
• The pass statement in Python is useful for holding min = numl If numl < num2 else num2 used to set up the class's variables.
the place for code to appear in the future. . # Print the GCD b. FIie. Handling :
• The first argument to every method in your class is
print(gcd(num1, num2)) • Python too supports file handling and allows users
[ 3.4 : Functions and Modules ] a special variable called self. Every time your class
to handle files i.e., to read· and write files, along
Q.18 What do you mean Modula· In Python? refers to one of its variables or methods, it must
with many other file handling options, to operate
a.13 Wbat ••function? &pialn with aample. Ans. : • A Python module is simply a file that ' precede them by self. The purpose of seli is to
on files.
distinguish your class's variables and methods &om
Ans. : • Function is a group of related statements that contains Python code.
• Each line of code includes a sequence of characters other variables and functions in the program.
perform a specific task. The . "def' keyword • The name of the file dictates the name of the
and they form text file.
introduces a function definition. module; for example, a file named math.py' contains • To create a new object &om the class, you call the
the functions available from the standard · math • The key function for -working with files in Python class name along with any values that you want to
• Syntax of Function : is the open( ) function. The openO function takes
module. send to the constructor. You will usually want to
def tunctlon_name(paramel9rs) : two parameters; filename and mode. There are fom assign it to a variable name. This is what the line
• A fython module can have a set of functi~,
different methods (modes) for opening a file : e • Example (8,6) does.
"""docatrlng- ~ or variables defined and implemented. In
the example above, we will have two files. 1. "r" - Read ·- Default value. Opens a file for • To use the object's methods, use the dot operator,
etatement(•)
• The modules of immediate interest to us are ~
reading, error if the file does not exist. as in e.addmodQ.
• In Python, functions are just one more type of
standard modules that contain functions that our 2. · "a" - Append - Opens a file for appending, Q.19 Eiq,laln daN lnhaffance.
object. Thus you can assign a function to _another
programs can use. creates the file if it does not exist. Ans. : • In object- oriented programming there is a
name, store them in lists or tuples, pass them to
• The Python standard library contains thousands of 3. · "w" - Write - Opens a file for writing, creates the concept called ·inheritance where you can create a
other functions, and so on.
functions distributed throughout more than 230 file if it does not exist class that builds off of another class.
• There are two basic types of functions : built - in
modules. These modules cover a wide range of 4. "x" - Create - Creates the specified file, .retums an • When you do this, the new- class gets all of the
functions and user defined functions.
application domains. error if the file exists. variables and methods of the class it is inheriting
• The built - in functions are . part of the Python &om (called the base class).
• Modules are imported from other modules using
language; for instance dir(), lenO, or absQ.
the import command.
13,6_: Classes and Exception bandllng • It can then define additional variables and methods
• The user defined functions are functions created that are not present in the base class, and it can
with the def keyword. 13,5 : Packaging and File Handling] Q.18 What I• daN In Python ? How It le cnatecl ? also override some of the methods of the base class. .
Ans. : • A class is a template for objects. It contains That is, it can rewrite them to suit its own
Q. 14 What i. function compoaltlon ? purposes.
Q.17 Write abort note on : the code for all the object's methods.
An8- : Passing the result of one function ~ as an
L Package b. file handling.
actual parameter to another function call JS called
function composition. T' TECHNICAL PUBLICATIONS, ._ An up_, for knowledge

~ -• or~T70NS, ._
T •TECHMCAL ,..._,~ An up thrust for knowledge
• 2~!!____ ____ _____3 _-6;--_ _ _ _ _
~~'!fl11btp
_ =~=':::::uctton
~- ---~& ~
~~- · Jn~'!fTlt'!':_~
- ;otlc flow of Contro l: Program mers can also -
use
3-7
- : - •
- _
-Co m _p -
_lex - -
e _
lem_
en -
ts - - -cons
are
~toP ytlu m
~ ~
-=cted:..:::~from=~.!:other
- -tru
!!!-'of'
• These exrepti ons are process ed ll8ing five elements hierarchically, wherea s simple demen ts
• e,cceptions as a basis for implementing unusua l
contain data values. Within an XML document,,
•Examp le : stateme nts. These are : control flow. Slnre 't here is no 'go to' statement in
respect . each element needs to be marked (or tagged) in
c.... Pa,.nt : 1. try/exr ept : catch . the error and recover · &o Python so exrepti ons can help In this
some manner similar to HTML XML elementstion, are
def _1nit_( 1elf. a): exrepti ons hoist by progra mmers or Python i ~ cka made up of a start tag, an end tag and Informa
3.7: Python Pa ges • JSON, XML, HTTP
1e!La • a 2. try/finally : Whethe r exception occurs or not; 1 Ub, URL Lib, SMTP Lib or content between them.
automa tically perform s the clean-u p action. t
conditi onally in th • An XML docume nt may also be valid. A valid
assert : triggers an excepti on
def method l(nlf): 3.
code. · , e Q.23 What 11 JSON ? docume nt is · checked against either a Document
Type Definition (OTO) or a schema. The followi
ng
pr!nt{n!La*2) Ant• : JavaScript Object Notati ~ (JSON) is_ a
def method2(aelf): 4. raise : manual ly trigger s an excepti on in the code. lightweight data - interch ange format based on the is a very simple XML docum ent
prlnt(nl f.a+'lll1 5. with/as : implem ent context managers in older syntax of JavaScript objects. It is a text - _based, <'?Janl V9I8lon =·t.O' ?>
olua Chlld(P anint): version s of Python such as - Python 2.6 &: human - readabl e, languag e - indepe ndent format for · < addre11 >
Python 3.0. <name>Rakabita Dbotm </name >
representing structu red object data for easy
a. b): Q.21 Why are Eiu:eptlona lJNd ? transmisSion or saving. <email > [email protected]<ma</email>
def _lnlt_( aelf,
<pbone >020-4& :6789</ pbDne>
n!La = a Ans. : • Exceptions allow us to jump out of random
Q.2' Why to med JSON ? <birthd ay> 1993-07 -13</bl tthday>
aelf.b =b illogical large chunks of codes In case of errors. Let
Ans, : • Compa red to its predece ssor In_server - client </addr eas>
def instbod l(aelf): us take a scenario that you have given a function to ,·
communication, XML, JSON is much smaller • The first line is a pro<:essing instruction. It begins
print(ae!La*7) do a specific task. rs, and better
translating Into faster data transfe with '<r and indicates the version of xml that is
• U you go there and found those things m,issing· µtat used In the docum ent
experiences.
are require d _to do that specific task, what will you
def method3(aelf):
do? • JSON exists as a "sequen ce of bytes" which is very TFN Structll,. :
print(ae!La + aelf.b)
- useful in the case Vo{~ need to transm it (stream) data • An XML docume nt exhibits a tree structure.
It has a
p = Panmt('bi1 • Either you stop workin g or think about a solution over a networ k. single root node; <address> In ~ exampl e above.
c = Chlld('bi', 'bye') where to find those items to perform the task. -The - . The tree is a general ordered tree. There is a first
print('P arent method 1: ', p .method l()) same thing happen s here in case of Exreptions aiso. ....,,, 1,
• JSON is also extrem ely human - friendly since it is
child, a next sibling etc.
·. textual, .and simulta neously machin e - friendly .
print('P arent method 2: ', p.method2()) • Exrepti ons allow program mers jump to . an • Nodes have _parents and children. There are leaf
exrepti on handle r In a single step, abando ning all • JSON has expressive syntax for rep~t ing arrays, nodes at the bottom of the tree. The declaration at
functio n calls. You can . think exceptions to an
I
objects, numbe rs and boolean s. the top is not part of the tree, but the rest of the
print()
optimi zed quality go - to statement, In which the document is part of tree.
Q.25 write abort note on XML.
progra m error · that occurs at runtim e gets easily
managed by ·the excepti on block. Ans. : XML Document • In the tree representation, intei;µal nodes represent
print('Chlld method 1: ', c.metbo dl())
complex elements, whereas leaf nodes represent
print('Chlld method 2: ', c.metbod2()) • When the Interpr eter encoun ters an error, it lets the • XML docum ents are text based. The basi~ object in
simple elements. That is why· the XML model is
printfC hlld method 3: ', c.metbod3()) executi on go to the ·e xceptio n part to solve and XML is the XML docum ent. XML documents,
called a tree model or a hierarc hical model.
continu e the executi on instead of stoppin g: Including XH1M L ones, must be ·well - formed .
Q.20 What le Except ion lwaclliag In Python ? These documffl.t is a labeled, unrank ed, ordered · • An XML document can be modeled as an ordered,
Q.22 Explain rola of an Except ion Handle r
In tree: . labeled tree, with a document node serving as the
Ana. : Python has many built - in exreptions which
Python . root node.
forces your progra m to output an error when 1. Labeled _means that some annotation, the label,
someth ing in it goes wrong. Ana. : • Error handlin g : The exrepti ons get raised is attache d to each node. · • An XML document can be modeled as an ordered
whenev er Python detects an error In a progra m ·at labeled tree. Each node in this tree corresponds to
• When these exrepti ons occur, it causes the current 2. Unrank ed means that there is no a priori an element in the document and is labeled with the
process to stop and passes it to the calling process runtim e. bound on the numbe r of childre n of a node. element tag name. Each edge In this tree represents
to j
until it is handled . U not h1111dled, our progra m will - • Event Notification : Exceptions are also used 3. Ordere d means that there is an order between inclusion of the element corresponding to the child
suitable conditi ons &: then passing result
crash. signal . the children of each node. node under the element correponding to the parent
flags around a program &: text them .explicitly. node in the XML file.
• For exampl e, if functio n A calls function B which in • There are two main structu ring concepts that. are
• Terminate Execution : There may arise. some used to constru ct an XML doewne nt : Elements • Now <name> has two children and <birthday> has
turn calls functio n C and an exrepti on occurs in
problem s · or errors in progra ms that it needs a · · three. Most processing on the tree is done with
a
functio n C If it is not· handle d in C, the exrepti on and Attributes.
' termination. So try/finally is used that guaran tees Attribu tes in XML provide additional preorder traversa l. One way to view the tree is
passes to B and then to A. ~t ~osing - time operati on will be_perform ed. The
o
shown in Fig. Q.25.1
inform ation that describes elements.
• In Python , exrepti ons can be handle d using a try with stateme nt offers•an alterna tive for objects that
suppor t it. _
statem ent T'TECHNICAL PUBLICATIONS' ·. An up
T.
1hnJ' 1 tor knowledge

TECHNICAl. PUBLJCATIONS - An up thtust for knowledge


JII""

~~Omp < - - - - - - - - - - - - -~3-~.9:__ _


- ~
,.,...,,., Keya for Fill In the Bianka

-
-
Q.1
Q.3 ·--·--·
----··
00Jl\pilation
null
unmutable
Q.2 list
Q.4 minimalistic
Q.6 associative uray
--
Q.5
Q.7 hashing Q.8 keyword

day
-
Q.9 libraries

,.,.._, Keya for Multiple Choice Quntlona


Fig. Q.25.1 XML document trN
[ 0.1 I a Q~2 , b Q.3 I· c
Q.7 The placement and lookup of an eletnent
<XML version = "1.0"7 >
within a dictionary uses a process knOWn ·aa END... .115
<address>
<name>
<first>Rakabita </first> Q.8 Python allows the caller to pass its actuaJ
<last> Dbotre</lUt> parameters in any order using a technique
</name> known as _ _ _ arguments.
<email>rdhotre>@ gamil.com</emall >
Q.9 Python provides a collection of standard
<phone>020-46-6789</phone>
functions stored 1n· ___ called modules.
<birthday>
<year>2002</yea r>
<momh>09</ month> Multiple Choice Questions for
,<:day> 29 </day> Mid Term Exam
</birthday>
Q.1 Python functions can have _ _ length
</address>
argument.
· •XML documents are ·self-desaibing, thus XML
prol-ides a platform independent means to desaibe (!l Variable !"b.] fixed
data and therefore, can transport data from
one ~ keyword fd'.] all of these.
platform to another. XML documents can be aeated
and used by applications. Q.2 JSON stands for _ _ .

/ Fill In the Blanks f~r Mid Term Exam I [!l JavaScript Order No~tion

Q.1 Python is an interpreted language and does


~ JavaScript Object Notation,
not require an explicit _ _ _ step. ~ J~vaScript Object Number
Q.2 A tuple is a sequence data type that is similar [}] All of these
to the _ _ _ .
Q.3 Python package is _ _ _ file structure-
Q.3 A pass statement in Python is a _ __
operation. [!) Binary !J?.:j Text
Q.4 Python is a _ _ · language with English [£1 Hierarchical @.] ASCII
like keywords.
Q.4 Each - in Python is a directOry which
Q.5 Tuples are similar to lists, except tuples are
MUST contain a special file called _init-•PY·
Q.6 A dictionary is sometimes called an _
because its elements vl!-lues are associated
with keys instead of indices. ~:-- ~==- T I a•
TECHNICAL PUBLICATTONS • An up th"'st ""
Lo kmW/od(16

T' TECHNICAL PUSLJCATIONS, ._ An up thrust for knowledg&

You might also like