Python Handwritten Notes
Python Handwritten Notes
Date
Page
*Assignmen Operataxs
Assiqnment Operators are use ton assign vlues ta
yaniables They include
Equal to [E): Assign the value on he tigbt to the
yaiable an the a.
Campaundassiq1ment opeators(=,-s t ) perfom
he pecihied artbnmetic dh erations and assign he rEsult
to vahiable
* ogical opgakors
loaical operaars in puthan are used ta perfaxm loqica
OperaiasaS- on Boalean values
logica) AND(ane): Retams tue if both apetands are tue,
otheruuise false.
Logical OR (o):Rekurns tue iE both ate one of them is true,
otheruise false
Logical Nor (nat): Returns he opposike boalean value af
the opeand
* Bitwise Qperasotg
*Mebership Opctatars
Membesshbip aperaors ane used to dest whether a alue is
a member d a sequence
n:Retuns thue i both gpetands reer to he same
abËec (sequence)
Not In Returns true boh opetands do not reters to
he same obiec Csequence)
entity Opetators
dentits Opetrators ahe uced tn campare the. identity o twa
ohjecks.
Is Retuns Trie if bath operands refer to the same
obiec
lss not Returns True i both apelcnds da do not refass to
chjed
the same abject
Copyrigbte by Codewith urious -Com
classmate
Date
Page
4List,Dietlonar set
ahdl Igpe onversion
Lt List
,,,- - - - t t - - - -- -- - - - -- - ~ -- - -- - -- - -
CopJ r~'nte ~ CodewiihCLrr10LIS Con1 I
/ - -- tt-- - - -- - - - - - -- - - ---, ----= -~ - --
Cop~ ri3ht~~ b_g CodeWi-lhC~r ious$ Com
' II h
•
SK)p
q
I qnatber b\ ads 1
Floul~htt ,i
- I
- I
-
I ffiar.\- )
-
... I
/~ Hl\.~e., I
\ ccndiho~ I\ I
\ / / -~~ [Link].
\ ~3/ /"\
I \8/ / ~ ~'\.
\ --g 1/
\3/
lfoe.. Tr11 P 71'UP [Link],
~L .L
I J BtoP ~,
S~ntax:
I'
-
if rnndi-hon1 :
. #- code -to be exewk.J i candi-lJonl is 1m~
✓- e\if conditioni:
,, =It coed e -1:o be ~~J ,1 co ndit, ao t ,:s l-aise , condi'ttan2 is !rue •
.,, e\i rnndi+1·on3 :
_,, =#=coc/e to [Link] J condrJt ,condYJ.Q. ,:S -ta}se,,, ({)nd,lJorJ3 is /rue ·
/
else:
=# coJe to be exewle. i al{ conc:Jitlor;s ctre. 1o)se ·
-
Seo e, = 7.5
e
I"
_,,,,,.-- - t i- - - - - - - - - - - - - - -- - -- - --
n1 :
e execuJ · mndi-hon1 1:S ,hue.,
income= 50000
- 18 :
/
for ct loa.n.''
e ·.
for q [oqn ''
else :
tint " o re. no+
q - - - 1-
. - - - -.,.tt----+-=-- [Link] :fof coro k_ruJ_c_9J ~- - - _ - -
________c~ qss M c 'L-ss
-""-'= -:- - -- - - - , - . . . . . - - - -- - - - -
ss ;mpl e.-men .fa1·an._ _ __
f ~
~ - - - t l t - - - - i - - - - = - ' - " ' ' - = - /- J--f-'~ = - i = . . . = ~::....,_ a.
- : -----------------...;
-~-~LJJ/ii_luQQf :---
.\e
_.__._----""wbile
--___..__ _ _ __J~, loop in P3:thon re _en:t_ed~ exe.c.u±e.s___
1
Cop4ri:1h-t~d ~ GJ~withCurious ·Corn
._
.. ·- - --- - ----·--
___Here~¾.e~ndi&;n:__id e_~te.ss10n__oLconditi0,;_-fhctLis __ _ .
'---- __ e,alua~Ed_before._eo.cb_i~ler_q_bJlJL...J F ibe_coo:li-h·~o_fs _-:-rJE. J __
1·
. --tl-+---LfoLi.tem_ln_ ~equencc:::.,___ _ _ _ _ _ _ __ _,
-_ _ _--+l - - - ' -' code.. blo_c~k J - - - - -- - - - - -
-- . . nw,·..L..,,-L....'.....:- - - - - -- - - - - ,
·n±-(-fruit,J - - - - - - -- - - - - - r - - -
lL !
,,
Ii
- - - - - - - - - --
ii
Coplpiqh{ed b~ coaewd.-hC~rio~s I (orn
.9g 1_
--~ £xc:1m le.Z ·. lletale _u.si ~ a ra~e ____________ _ --- -~------
- _: __for_~ in _tu1J9e(1.5)
-___: ___ ____ nnt (,) _
--~=-- - _- _-_- ____ ---=--~-=-
= ----- ------
- -~ -- ---- -
- ---·--:~-0 ut._: - -- - - - - - -- - - - - - - - -
--- ' __ 1_____________________ - - - - -
-t· - - - - - - - - - -- - - - ~ - - - -·
- · ·· --·· -
3
- --- -- -4- - - - - - - -- - - - - - '-
------- ·:--- - -- -- - - - - - - - - - ' -- - - . -
. --- - _.; -- - - - in-=tbe._aho_ve_~ctmfk~_be_.rg,Q_ge.,_(13)_-Euncli'on_
. - --·! _9en~rates_a _15e9uenc.e,_J ____nuro\:ie.t;s__from_ i_-f:o _-1, (exc\ucive)___
. ---~e- loD?- Yar.1oble i ~hes~t\1e.__rn\ue. 4-~cb- numb_eLi n_::the
_____-~--s~uenle4 _and__4b~-rrmlCi)_~krnen1-_ nrrk_ea.ch_n_vmbex_. _
1
--r
S9
-----,J-__:_===~=======================----- ----
1
-~j_Dufyltt:--:_____ _____
0
I 2...
' .3
i--------+-;Emm~LU leta..k_ltli-l-h_CLCYJom_rctt:i2e.-_c\JlLcii-cr---- -
e---- 'l i=====::=:::;===: :;;:::::=== = = = = = = = = = r- -
r.---~ ' _ lti_j_o_ ra nje_U_J.lO1~ :
r.--------....i-,--p_rio± (i)_____ _
r- -.Lout T,( ~.- - - - - - - - - - - - - - - - . - - . !
'1
II
"
- - ~ -- - -- - - - - -- - - - - -----------
~ :i 7· Ll,g:lhutL~S~i~L~D.8b--- - - - -- - - -- -·- --
!
- - -- - ... . - - - - - - - - - -·
(op~ riqbled ~ CotjeN ithC~r10Lls •Corn
II
,, Hello
; )1'\ot \tj
11 f.~ InoY) is r,ower/uJ \an.3W!8 e..
!! In ·lh_e._a_bo-ve- ex_e1_mr-1e.-, _w_e_c._rea_l_e,_·lh-re:,__e_d_i_rl--1er__.[Link]
\Shin_9.s ualn.3 .sin3\e 9u.o!:ea, double: 9uole;, ond ~[le. 9u.c~e,s
., A\\ -lfae.e. wo,p [Link] valid fo1 [Link].~ filii0_315 in fl tho n •
I
I'
I
I
--
-------- ~-sko_g = ' ~elLo_,Jdo.r~-'-' _ _ _ _ _ __
--
____ _ --~ - _to~ __Ju·123 -=-[Link]'-- - - - - - - - - -
- -
___________________\[Link]-s _method ,Jhe. _variable.. m_g_~1'n3- __
____ . J-s_u-s.s~n~d _to _v.a!Ll~_None, ett~chy~ _deJf.~·n~ ~tdn_g ·
-=__. ~~-U6~ the •a·~-k~~6~J.-
ii r = ' Hello'
~ - - -- - - - - - - - - - t - -
i : . - - -_____.__,t----~ .= '' - - - - - - - - - - - - - t - -
= ,, WOL.Ld_
eouH- = sh + cir 2.
c----,LfxqmpLe..~:_ _ _ _ _ _ _ _ __ _ _ _ _ _____,;
" - -- - - - - - - - - - - + - - -
1 == '1 He!LQ _
r--~1- --~~u.} t- G'tfj_ ~3- - . - - - - -- - - - - - 1 - - -
----1----P_rhJ±:_ltes_tJ-ll)_ -i.E ~ c t ; ; t -1 e Io ell o
- - -
,----;:bqmFle_~ _ _ __ _ _ _
-= F_=s==;:_=:J:_-==:_"~H::::;:
H=-
= == = = = = = = = = l
- -~CLL..L--'~~ ,_wom~''-- - - ~ - - - - - --
--t--~[Link]:t_(std [6 ~ 11]) =#-ou±f Ltt : W~rltjl - - - - -
. -----
__ E--xqmple·-_ _ _ _ _ _ _ _ __