Python
Python
~
T4TEQ SOFTWARE SOLUTIONS
,4
PYTH'" •, '3 Fi!i. 2 - 32
TUE.Q YITT\".A.Rr SOlllTlO' S
COURSES OFFERED
\li.in,t;igr.im.wm t4tCijsof1\\i1re1
rATCQ SOFlWARE SOLUTIONS r 11 ti I I I I I 11
INl>I X
2 I h~tLlt°)
Operators 7
5 Operator Exercise
6 Predefined Functions 9
7 Exercise Programs 12
9 Interview Exercises 20
11 ASCII Chart 32
r
T4HQ SOffiVARE <;QLLITIONS
SYLLABUS
• lntrtiduction to P) thon
• P) thon Operators
• Control Statements
• Functions
• Strings
• OOPs Concept
• Exception Handling
ADVANCEPROGRAMMINGlNPYTHONSYLLABUS ~
• Brush-up Session
• File Operation
• Multi-Threading
• Python Database
• Regular Expressions
• Networking
• GUI Programming
• Data Science
• Machine Learning
6
1 2, 4
cl~
nt(I, b. C, d)
Ex.: 2 '"...Multi
Line
String"""
~rrini;! l\lrthocl,
ll, , ,.11p1 l1111
._,nhl\
:inn , t:, 1p1 l ii Ill I l I 1111\ l II 11 11 I 11 I ' li .11 h 11 I l '1 111 111 I l I
S~·ntax Description
list.append(obj) Appends object obj to list
list.count(obj) Returns count of ho\\ many times obj occurs in the list
list.e.\tend(seq) Appends the contents of seq to list
list.index(obj) Returns the lowest index in the list that obj appears
list.pop( obj=list[-1]) Removes and returns last object or obj from list
list.remove(obj) Removes object obj from list
list.re,erse()
Reverses objects of the list in place
Iist.sort([ func])
Sorts objects of list. use compare func if given
.....nl(ftllUI,)
. . . . . .ll(IIII
i&tllllnm•Jupdate()
)
Rem -I
other peclfltd )
Rlhlml whllhlr - - L.-• _..-, ,_liilill[lll!!llal'IIII-
Retuml whldllr IIIOlhll' NI
Rtluml~th ...
Remov11111 eltrnent hm dr, •
Rtmov11 the lpldW 11 • __. .....
1
Returnl I llt with the ay....-1, t1111 11
lell
IIINrtl Che IJIIIDletriO diAe-
tnodler
Return a let containinJ the onion ~-"'"-:;:;,_
Update the let with lhe IUDOII o/111111t•_11
Dllcription
The copyQ mclbed retul'III I - - ~
dictionary.
The ,lear() method lallOVCI all itmll ima dll
T4TtQ SOFTWARE SOLUTIONS
PYTHON 3jp
age ii
Of 3~
PR \(TICF rxr:«c1s1 :s
-btJbL 4oc
x=
20
J/P: l/P:
-9 -6
20 9
0/P: 0/P:
54 33
2. Write a program to find the biggest & smallest of given numbers using a logical op?
Test Case I: Test Case 2:
I/P: 1/P:
12 17
14 12
17 257
0/P: 0/P:
17 12
257 12
OLUTIONS
T4HQ ~on WAR( s , ·· 111 he cxp11.:"~cd .I!, ~1111, uf I
• '11 11111111K I I,; , I
' 1'I\ ~
IIll t
111 CIIll
.. ~ \\ Ill·thi:1 vn IIll.! )
\\ I lh,' .1 fun,11,,11. I no,1!1:.tll
, ·t··d
ti \ l11,l •
l )11tpt1 ()/fl J 111c
\flllll' 1111111h·1'
l
!IP · 20 OIi' htbi.!
il''' c.1, 1.' I
, ., 11r · l 7 ·,1tcgi,c11 nu111 bcr.
1,.:-t l ,l~~ - - l th!.! ractoriol of
I" \\ tit.: ,1 r~•( u 1,1, l• fu11dit11l IC1 I llll O/P : 120
2014 4422
Programs in String:
18. Write a program to find the GCD for the Unicode values of the given string?
Test Case I: 1/P : sinZ 0/P 5
Test Case 2: 1/P: TEQ O/P
19 Write a program to remove the next char, near each vowel of the given string?
Test Case I: 1/P : Nama Company O/P : NaaCopay
Test Case 2: 1/P : Science Fiction O/P : SciceFiti
20. Write a program to find the frequency of chars in the given string, and print the 1110s1
frequent character of the string?
Tc)t Case 1: 1/P : charaCteR
1/P : t4tcq
(l 'f' : t-2c. ( q-1
,,,1osOrTWARI OLU11nt~ 11
\\ ('ll 111 1,lll11n I pLiu lhl \•01d or1I 111 lhl 111 lrl 1111 IIIIClllL~ 111 lit~ l'IVCII ,11111 11
111a11ro hln1.
npp k red
0/P ; 0 /P :
11/'f'/, If ///.Ill' mr111P11 i1 re/Im, rt/!/1/c• is 11111.1 ,,,rJ I', blr1r ,. that ym,, ! lol'i' 11'/I hllie
Lisi Prohlrm~:
~1 \\ rile a rrognun to so11 the pos iti ve and negative nurnbcrs from a !isl of11111nhcr,. (/.cro
should he co nsidered a negati ve number)
lc~t Case J: Test Case 2:
1/P; l/P:
I 2 I4 -5 18 -6 -7 -12 -14 0 -18 S -6 -7
0/P: 0/P:
I 12,14,18,-7,-6,-5] [5,-18,-14,-12,-7,-6,0J
0, @. Write a program to get the fibonacci series till the given value (dynamic programming)
Tc~, Case I: 1/P : 100 O/P : 0 I I 2 3 5 8 13 21 34 55 89
Test Case 2: 1/P : 52 O/P :0112358132134
25. Write a Python program to count the number of strings where the string length is 2 or
more a11d lhe first and last characlers are same from a given li st of strings.
Test Case I : 1/P : abc xyz aba 1221 O/P: 2
Tesl Case 2: 1/P: treat the students like a king O/P: 2
26. Wrik a program to split every Nth element in a list.
• • • iii "
1 est Case I: 1/P abcaefghijklmn
3
O/P ['adgjm', 'bchkn', 'cfil'l
Ti:~t Ca,c 2: 1/P t4teqsoflwares
2
0/P l'llqolac·. '4csfwrs']
T4T£Q SOFTWARE: SOLUTION~ PYTHON lJp
ag" lr,
r,f 31
\l.i ( ) \\ fl'l' l1 . t u~lllf J{.idix ~,,11 All'"l1tltm 1
prr>rrn111 ,,, ~ort th~ g1, l II 11~
O/P: 27
29. Write a program to find the multiplication of2 identical matrices?
Test Ca~e I: 1/P : 3
I 2 3
4 5 6
7 8 9
9 8 7
65 4
32 I
O/P:
30 24 18
84 69 54
138 114 90
Set, Tuples and Dictionary Problems:
30. Write a program to reverse each number from the given tuple?
Test Case I: 1/P 123, 15,91 ,23,42,7
0/P 321,51,19,32,24,7
Test Case 2: 1/P 19,45,67,34
0 /P 91,54,76,43
31. Write a program to find the intersection and union of the given ru o sets ½ithout using
pre-defined functions?
1est Case I: r;p
1,2,3,4,5,6
4.6,8,IO
0 /P {4,6} { 1,2,3,4,5,6,8, IO}
r,na SOFTWARE ~OLUT IONS F'fl11r 1 N 1r ,, 11,137
I.C,.H. I 0
0/P { I .:,I,.~ 8, 10)
Ii.:~t Case 2: l,P 12. IJ. l •I
12, 13. I •1
0 /P {}
33. \\ rite a prog1am to get the nth biggest clement rrom beg i1111i11g and e11d of a tuple'/
fest Case I : 1/P : 123, 15,9 1,23,42,7 -~, l•,t9d/4?>)~il, 1;,~
4 IJ , \ :{ / J I
0 /P 42 23 0 .i
Test Case 2: 1/P 19,45,67,34
2
0 /P 34,45
34. Write a program to convert all the elements from decimal to binary from the given tuple?
Test Case I: 1/P 123, 15,23,42,7
O/P I I I IO I I, 11 11. IO I I I, IO IO I0, I I I
35. Write a program to split all the number in the tuples to digits, and remove the
duplication?
Test Case I: 1/P 23,49. 122, 135.98
38 V. rite a class to find the set of three elements that sum to zero.
1/P
-25,-10, -7. -3. 2. 4,8.10
Test Case 1:
O/P [[-I0,2,8] , (-7 , -3, 10]]
O/P [[-2,-3,5]]
39. Write a class to create five user defined string functions and access them with an objecr
• String Length
• String Compare
• String Reverse
• Vowel Count
• String Zipper
40. Write a program to solve the following problem using exception handling?
Test Case I : 1/P : 3 5 O/P : 8
Test Case 2: J/P : 1era so ft O/P : teraso ft
MINI PROJECT
I. Examination System
a. Staff Login
i. Approve Students
ii. Create Exams & generate Report in File
b. Student Login
i. Create Students
ii. Attend Exam & Report
2. Flight Reservation System
a. Passenger
1. Sign in
IN I 1 l{VIFW T·\SI\S
1 Tl
lotH 11 , 11111111 til 1 \\llll ,1 p1,, 1,1,1111 t11 l11ul 1111,l\11ll111111111111l 1l'r that cnn he lo1 111 ~d
11s111t• ,II 111 tin· d11•11 , 11I 1h1, 1111111hl' I
I I' ~N"•>'l lh ( l I' 1lN /(l 111 l
" ( h1·1. " it 1111.· I' iH·ll , 111111• s IS ,I 11.lllpl:1111 Ill 11111 A p.111!'1,llll 1, a ,c11ICllCl' co11tain1ng
nvl\ kth'1 111 tlw I 1ll'l1~h i\lphalwt
t i1H·11,1 , ,illll· I h1.· 1,1,I-. "to l111d IHi\\ lllilll) 1111111lw1 s k'ss than or equal to N ha\c
111111ih1.·1s 111 d1, 1'1Hs l''\i11.·th 1.·q11,d to 1
t ii.'! .1 1111111h1.·1 , di\ ilk till' n11111b1.·r \\ ith all !Is cl1v1sor, 1111d ,11111 it.
l' 1 1' 111 l11111 p:11ts (I'\ I 1/1, 11/ 1,1~/hl
1 {6, I, U) ➔ 6 11t1-+2 15
' \ I m·.i, N11llllll'1 i, 111111111b1.·r \\hich is n:pn:scnlcd by the following rccurrcncc
I II I 11 1 1 I " , for n I
I ll ,,
l1 1/P : 9 O/P : 76
h. ('011111 Di, isors
, 1.111 h:1' c IK·1.·11 gi\'1.'11 1 intcgcrs I. r nnd 1-. . rind h0\1 mnny numbers between I and r
tboth 111cl11si,c) arc di,isiblc b) 1-.. You do 1101 nccd to print these numbers, you just
hav1.• to tind their co11111. 1/P : IO 20 2 O/P : 6
E,ptaualion : numbers di, isiblc b) 2 in the range IO to 20 are I0, 12, 14.16.18,20 :
l'ount - {J
7. Lnsl O Bils - Occimnl \'nluc
l'hc prngr:un must accept two positive integers N and Das the input. Then the program
mu:;t print the dccimnl ,:due represented b) the last D bits in the binal) representation
ofN. l/P:10 3 O/P : 2
faplanation : Binar) cqui,alent of IO is IO I0. last 3 digit are O10, decimal value of
010 is 2
8. l\tulliplcs in Range
fhc program 11111st :iccept vc integers A. B. X. Y and Z as the input. The program must
print the multipll's of X. Y and 7 in the range from A to B (inclusi\'e of A and B) as
thcoutput. I/P:215 3-16 0 /P : J-16 891215
9. Sum and Average - E\'cn and Odd
rhc program must accept a list of integers as the input. The program must print the
sum of e\'en integers in the list then the program must print the average of odd integers
in the list \\ ith the precision up lo one decimal place. If there is no e\en integer odd
integer in the list, the program must print -1 .
6 1I
I
7 12
2
13
.,
"\ 8
9 14
4 ,1
.
10 15
5
I
T4TEQ SOFTWARE SOLUTIONS PY'THON 3 I Page 20
a
Lo 2
1/P : 9 O/P : 76
L 1= I
6. Count Divisors . . rand k Find how many number5 between I and r
You have been given integers - 1,
. . d' •·'bl b k You do · not need to print
3 . these num bers, you jusi
(both 1nclus1ve) are 1v1s 1 e Y · • 0 /P : 6
1 20 2
have to find their count. 1/P · O
Explanation : numbers divisible by 2 in the range I O to 20 are I 0, 12, 14, 16.18,20 .
Count - 6
7. Last D Bits - Decimal Value
The program must accept two positive integers N and D '.35 t_he inpu_t. Then the program
must print the decimal value represented by the last D bits 111 the bmary representation
ofN. UP : IO 3 0 /P : 2
Explanation : Binary equivalent of IO is IO I0, last 3 digit are OI 0, decimal value of
010 is 2
8. Multiples in Range
The program must accept ve integers A, 8, X, Y and Z as the input. The program must
print the multiples of X, Y and Z in the range from A to 8 (inclusive of A and 8) as
the output. 1/P : 2 15 34 6 0 /P : J 4 6 8 9 12 15
9. Sum and Average - Even and Odd
The program must accept a list of integers as the input. The program must print the
sum of even integers in the list then the program must print the average ofodd integers
in the list with the precision up to one decimal place. If there is no even integer odd
integer in the list, the program must print -1 .
( ommon f err or s - Dr
,re nd ing On h•r
11. •
•·c , \ .. , 1"-' n~ I1ll: 111pu1 I he propram 11111,1
lcp l t\\u ()l rti l lllk , " 11 r
I he 1,ro mm 11111<;1 nc
m 01 X and 't 111 the cfo
scL·nding 11rdcr.
prrnl &he l·o mm on foc1< O
_ nir Digir - lfr ph ll'(•
b~ fl I
12 1 N a • ti · · I program must replace n t 1e
I h,. pro •mm lllt hl acc. ep. .
t an ..int ••g er s 1e 111put. r 1c
program mw,t print
• th c 111111 drg,t of N b} 0 in the integer N. rinally, the
lll'l um·nccs of
the output.
thr modicd \aluc of N as 20
I 021 Ou put:
Input : occurrence of I by
e un it dig it of I 021 is I. So after replacing all the
i:,planation: Th 20.
n. the rnteger becomes 00
JJ. Palindrome - Bina
ry Representation
print YES if the
pt an int eg er N as the input. The program must
The program must acce must print NO as the
tation of N is a pa lin drome. Else the program
binar: represen
output.
Output: YES
Input: 5
I. Output is YES
representation of 5 is IO
Explanation: The binary
14. Vowel Positions nt the vowel
a str ing va lue S the input. The program must pri
The program must accept nt -I as the output.
such vowels in S then pri
positions. If there are no
redth Digit
15. Reframe with Hund val ue X (sum of unit digit, ten
th digit
an int eg er Na nd a sum
The program must accept The hundredth digit is rem
oved from N. The
it of N) as the inp ut.
and hundredth dig it as the output.
st nd the hu nd red th dig it and print N by reframing
program mu 12569
69 20 Output:
Inp ut: 12 e deference between 20
Th e sum of the las t tw o digits in l 269 is 15. Th
Explanation: raming the N is 12569.
is 5 (20 -15 ). So the hu ndredth digit is 5. After ref
and 15
Q.No. Sign
Q.No. Sign
Q.No. Sign
11
6
I
12
7
2
13
8
J
,- 14
9
-
4
15
10
5
~
~
pnHON 3IP 22 32
' 0 c•
' ~~ ', • @(I (I FTWARE SOLUTIONS
T4T£QSO
. w Questions
Python 3 - 1nterv1e
1 "hut i, r, thon} . , I scripting l,111r u,1gc. P) them
. . . i ohjc:d-011c:11tl.:l .
. . . ·I ti:rpil'h:d. i111i:-i.1cllH .,m · . . ui.:ntl\~ " 111.:rc ns other
p, thon i:, ti h1gh-k," · 111 • . h ~i.:\ \Hinh 1n;q
. ll It use-; l·ng 1 ,~ . I
• •1 . ,J t" lP lrn!hl,• rcadn 1 c. · · , • . I con~truc l. ._ th:m pthcr angungcs.
·
1:- uc:--1i;_1h: ,. " - 1011
. ,1 11 d 't1 ha,
'-
rcwcr S\· nrnt!H;,l
l:lngu.igi:-~ ll'•l' puni:-1uat1011.
·, t fratures of python -
•
Folll)\\tn!! are some ol• the sa 111.::n
~ d roornmming met1,o ds as well as OOP.
st
• It supports functional and ructure P t i ' . b,te-code for building
• lt can be used as a . .
scnptmg language 0 r can be compiled to ·
large applications. . k·
. d
• It provides very high-level dynamic data t)pes an supp orts dvnam1c
· t) pe chec ·mg.
PYTHONPATH - It has a role similar to PATH. This variable tells the Python interpreter
,,here to locate the module files imported into a program. It should include the Python source
library directory and the directories containing Python source code.
PYTHONC ASEOK - lt is used in Windows to instruct Python to find the first case-insensiti,·e
match in an import statement. Set this variable to an) value to acti\'ate it.
• Numhl!h
• St1ing
• l i,t
• I 11pk
• D1ctionn1)
It will print characters starting from 3rd to 5th. Output would be llo.
II will print characters starting from 3rd character. Output would be llo World! .
It will print string two times. Output would be Hello World!Hello World! .
14. What is the output of print list iflist = I 'abed', 786, 2.23, 'john', 70.2 J?
It will print concatenated lists. Output would be [ 'abed', 786, 2.23, 'john', 70.2 ].
15. What is the output of print list IOI if list = I 'abed', 786, 2.23, 'john', 70.2 I?
It "ill print first element of the list. Output would be abed.
16. What is the output of print list I l :3) if list = I 'abed', 786, 2.23, 'john', 70.2 I?
It v.ill print elements starting from 2nd till 3rd. Output would be [786, 2.23].
T4TEQ SOFTWARE SOLUTIONS
· 1·1st! 2: 1I·11·1st •
17. \\ hat is thl' 111111ml 11fp1111I
I' I II·" 'I' , 7HC 1 , 2 •l\~, 'John'. 711 •2 \?
, 21 '10h11',
It \\1II p11nt ck111~11ts tu1ti11g lwm 1111 ~k:111c11t t l111p11t \\uuhl he \.. •
"'0 .:?0000000lH)llll001 l
I H. \\ hat is tht• output of print tin~ li'.--1 * 2 if lin) li..,t • 112.\, 'john'!'!
11
It" ill pr111t li,t '"'' ti1111;":, l h1tp11t \\lllild \ll;' 112\ ',ioh11'. 123, 'joh 'I •
23 '1'ohn', 70.l
. . . 1·. • 2 'fl" t t '·1hcd' 1Ht,, 2 . •
t '>. \\ hat is tht• outpul of pnnt h,t -I t111y isl 1 1s • • •
The main differences between lists and tuples arc - Lists arc enclosed in brackl.!ts ( { I ) and
their elements and si7e can be changed. while tuples arc enclosed in parentheses ( ( ) ) and
cannot be updated. Tuples can be thought or as read-only lists.
22. What is the output of print tuple if tuple= ( 'ahcd', 786 , 2.23, 'john', 70.2 )?
It \\ill print complete tuple. Output would be ('abed', 786, 2.23, 'john'. 70.200000000000003).
23. What is the output of print tuplclOI if tu11lc = ( 'abed' , 786 ,2.23 , ,J
· o , 70
h n , . 2 ).?
It \\ tll print tuple t\,o times. Output would be (123 , 'john'. 123, 'john').
27. What is the output of print tuple+ tinytuple if tuple= ( 'abed', 786, 2.23, 'john',
70.2) and tinytuple = (123, 'john')?
It will print concatenated tuples. Output would be ('abed', 786, 2.23, 'john',
70.200000000000003, 123,1ohn1.
Python's dictionaries are kind of hash table type. They work like associative arrays or hashes
found in Perl and consist of key-value pairs. A dictionary key can be almost any Python type,
but are usually numbers or strings. Values, on the other hand, can be any arbitrary Python
object.
Dictionaries are enclosed by curly braces ( { }) and values can be assigned and accessed using
square braces ([]).
diet {)
diet (' n ~ II
diet 2, tw
tinydiet : .- q, '. '
- - -
30. How will you get all the keys from the dictionary?
Using dictionary.keysQ function , we can get all the keys from the dictionary object.
31. How will you get all the values from the dictionary?
Using dictionary .valuesO function, we can get all the values from the dictionary object.
long(x (.base])_ Converts x to a long integer. base specifies the base ifx is a string.
PYl HON 3 IP;ige 26 of 32
1•HQ 1;011WARI ~Pl\lTl(lN~
I ,,
q ))t,,, ,11l1 \1•1111•11\t II U ,1111tU to II 111 11\I Ill pit \OIi ,
,,
\Ci llo\\ "ill, 1111 win,.,11111 c•hlnl 11111 ~ll 1111! 111 JI) I I11111
•
.17 llo\\ "ill HIii ,•1111, ,·rl II Strini.: IO 1111 ohjN't in python'!
45. How ,,ill you convert a single character to its integer v.1lue in python?
l I. t 'I. )
- c1,n, crt, nn 111tcgcr to nn oc1,,1 string.
.ss. \\ bat is the purpose of •• operator?
•• E.,pt,ncnt - Performs e,ponential (power) calculation on operators. au b = IO to the power
: oifa= 10andb = 20.
floor Di\ is ion -The division of operands where the result is the quotient in which the digits
after the decimal point are removed.
is - E,aluates to true if the variables on either side of the operator point to the same object
and false otherwise.xis y, here is results in I if id(x) equals id(y).
not in - Evaluates to true if it does not finds a variable in the specified sequence and false
otherwise. x not in y, here not in results in a I if xis not a member of sequence y.
break statement - Terminates the loop statement and transfers execution to the statement
immediately following the loop.
continue statement - Causes the loop to skip the remainder of its body and immediately retest
its condition prior to reiterating.
pass statement - The pass statement in Python is used when a statement is required
syntactically but you do not want any command or code to execute.
SS. How can you pick a random item from a list or tuple?
r drnn e (( tart,] stop [,step]) - returns a randomly sc Ieel!! d eIemt.:·nl from range(start. ~11,p.
Step)
T4TEQ SOFTWARE SOLUTIONS PYTHON 3 j Page 28 of
32
random() - returns a random float r. such that Ois 11:ss than or equal to rand r is less than 1,
SS. How nill )Ou set the starting value in generating random number~?
,1,;i:d([,j) Sets the integer starting \alue used in generating random numbers. Call this
!unction before calling anj other random module function. Returns None.
61. How will you check in a string that all characters are alphanumeric?
isalnum() - Returns true if string has at least I character and all characters are alphanumeric
and false otherwise.
62. How will you check in a string that all characters are digits?
isdigit() - Returns true if string contains only digits and false otherwise.
63. How will you check in a string that all characters are in lowercase?
islowerO - Returns true if string has at least I cased character and all cased characters are in
lowercase and false otherwise.
64. How will you check in a string that all characters are numerics?
isnumeric() - Returns true if a unicode string contains only numeric characters and false
otherwise.
65. How will you check in a string that all characters are whitespaces?
isspace() - Returns true if string contains only whitespace characters and false otherwise.
istitle() - Returns true if string is properly "titlecased" and false othem ise.
67. How will you check in a string that all characters :ire- in uppercase:'
isuppcr() - Returns true if string hns :it lcn\t om: cased d1:irnctcr nnd nil ca,~•d d1ar.1l'tcr, nr.:
111 uppcn.:ase and fal')c otherwise.
T4TEQSOFTWARE SOLUTIONS
PYTHON 3 IPage 29 of 32
ljust(" idth[.'dfillchar])
I - Returns a space-padded st1_.mg with
. the ong111al
. . string left-justified to
a tota I o f \\ 1 t 1 columns.
73. How will you get the max alphabetical character from the string?
max(str) - Returns the max alphabetical character from the string str.
74. How will you get the min alphabetical character from the string?
min(str) - Returns the min alphabetical character from the string str.
75. How will you replaces all occurrences of old substring in string with new string?
replace(old, new(, max]) - Replaces all occurrences of old in string with new or at most max
80. How'" ill you check in a string that all characters arc decimal'!
isdecimal() - Returns true if a Unicode string contains only decimal characters and false
othem ise.
81. What is the difference between del() and remove() methods of the list?
To remove a list element, you can use either the dcl statement if yo u know exactly which
element(s) you are deleting or the remove() method if you do not know.
[!, 2, 3, 4, 5, 6]
True
123
92. Ho" "ill you get the m:n. "alued item on a list?
93. Ho" "ill you get the min valued item of a list?
list. index(obj) - Returns the lowest index in the list that obj appears.
95. How will you insert an object at the given index in a list?
96. How will you remove the last object from a list?
list.pop(obj=l ist[-1]) - Removes and returns last object or obj from list.
03
SlX 34 .. 65
66
A
B
97
98
0
b
ETX
04 35 # 67 C 99
EOT C
5 Et.a
36 s 68 D 100 d
06 ACI<
37 ,0 69 E 101 e
07 38 & 70 F 102
BEL 39 f
8 BS 71 G 103
•etr Cf'S' 40 g
09 HT 72 H 104
t3b t>o•i.:crn, 41 h
10 LF 73 I 105
SB '0~ -:a 42
11 VT 74 J 106
tab rcr: ~a 43 j
12 FF + 75 J< 107
'er 'e:-~ 44 k
13 CR 76 L 108
e•orrio oe e4rro 45 I
14 so {S 't )u·
77 M 109
15 46 m
16
SI s" fl kl 47
78 u 110 n
OLE din rr,. e!ca:,e I 79 0
17 48 111 0
DC1 "e. ic, cor.,ro 1 0 80 p 112
18 49 1 81 p
DC2 0=, ~e ct~:ro : Q 113
19 OC3 50 2 q
{d~. cecor-t o: 82 R 114
20 DC4 51 3 r
21
J:!.-:cccntro.:
UAK nega•. ~ ec 52 4
83
84
s 115 s
22 SYN
C\' = 53 5
T 116
t
S) cr•,nous ·..e 85 u
23 ETB 54 6 117
:-:lc,(•a..,~b"c• 86 V u
24 CAtl 55 7 118
ceni:~
56 87 w V
25 EP1 8 119
26
~ j O; /llEll:u
57 88 X 1//
sue St;t_s• ..,•e 9 89 120 X
27 ESC 58 y 121
csca:e 90 y
28 FS "'-!:s".a o't
59
91
z 122
z
29 GS 60 [
~re ;, 'Sf.,:i• ator < 92 123 {
RS 61 \ 124
re .:m !e:;.-.u:,tc• = 93
31 us 62 ] 125
I
127 i..ri S!;a"!tor > 94 }
DEL 6J /\
Oe- '" ? 95 126