0% found this document useful (0 votes)
1K views

Al Ict Notes - 04

This document provides an introduction to Python programming language concepts including variables, data types, operators, conditional statements, loops, and functions. [1] Variables are used to store values in programs and can be assigned using the "=" operator. Data types include integers, floats, and strings. [2] Conditional statements like if/else are used to execute different code blocks depending on conditions. [3] Loops like while are used to repeatedly execute a block of code as long as a condition is true. [4] Examples are provided to demonstrate concepts like input, output, arithmetic operations, and looping.

Uploaded by

shanketheesh
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)
1K views

Al Ict Notes - 04

This document provides an introduction to Python programming language concepts including variables, data types, operators, conditional statements, loops, and functions. [1] Variables are used to store values in programs and can be assigned using the "=" operator. Data types include integers, floats, and strings. [2] Conditional statements like if/else are used to execute different code blocks depending on conditions. [3] Loops like while are used to repeatedly execute a block of code as long as a condition is true. [4] Examples are provided to demonstrate concepts like input, output, arithmetic operations, and looping.

Uploaded by

shanketheesh
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/ 6

2019 Batch

jfty; njhlu;ghly; njhopy;Dl;gtpay;

A/L Information and Communication Technology


Programming
2019 Batch
PYHTHON PROGRAMMING LANGUAGE
khwpfs; (Variables)

 fzpdp epidtfj;jpy; jw;fhypfkhf Xu; ,lj;jpid cUthf;fp juTfisr;


Nrkpj;Jitj;jpUg;gjw;F nra;epuy;fspy; (Programs) khwpfs; gad;gLj;jg;gLfpd;wd.
 khwpapDs; ngWkjpfis toq;Ftjw;F (assign) “=” equal sign gad;gLk;
 “=” (equal sign) w;Fgpd;dNu toq;fg;gLk; ngWkjp ,lg;gLk;
 Fwpg;gpl;l jutpw;fhd epidtfj;ij jw;fhypfkhf gpujhd epidtfj;jpy; khwpfs;
ngw;Wf;nfhLf;fpd;wd

KO vz;iztiuaiw nra;jy; (Integer assignment)

vDk; NghJ

,r; nra;Kiwia nraw;gLj;jg;gLk; NghJ vDk; FwpaPl;Lg;ngaupd; %yk; epidtfj;jpy; Xu; ,lk;
cUthf;fg;gl;l ,Ds; vDk; vz;iz Nrkpg;gjw;FFupa ,lk; gpujhd epidtfj;jpy; xJf;fg;gLk;

,Ds; Assign gz;zg;gLk;

 vd;gJ khwp (Variable) MfTk;


 vd;gJ Assignment Operator MfTk;
 vd;gJ ngWkjp (Value) MfTk; fhzg;gLk;

jrk vz;iz tiuaiw nra;jy; (Floating point)

khwp xd;wpd; vz;fis toq;Fk; NghJ jrk vz; toq;fg;gLkhapd; mJ jrk khwpahff; fhzg;gLk;

,q;F epidtfj;jpy; ,w;Fupa ,lk; xd;W cUthf;fg;gl;L ,Ds; vDk; jrk vz;
,lg;gl;L (Assign) mJ Float Variable Mf jw;fhypfkhf Nrkpf;fg;gLk;

nrw;fis tiuaiw nra;jy; (String)

khwp xd;wpDs; “ ” ,Ds; toq;Fk; juTfs; nrhw;fs; fUjg;gLk; ,k; khwpfis vz;fzpj ju;ff
;
nraw;ghLfSf;F cl;gLj;j KbahJ

address=”Meesalai”

P.Bipunaath ICT 0757746217


2019 Batch

>>> age=26 vDk; nra;epuiy (Program) fUJk; NghJ KiwNa 26,


height, name vDk; khwpfspDs; ,lg;gLfpd;wJ. ,k; khwpfs;
>>> height= 154.2 ,g; ngWkjpfSld; epidtfj;jpy; jw;fhypfkhf
Nrkpf;fg;gLfpd;wd.
>>> name="Raja"
NkNy $wg;gl;l nra;epuiy (Program) nraw;gLj;Jk; NghJ :-
>>> print(age)

26

>>> print(height)

154.2

>>> print(name)

Raja

>>>

>>> x=20 ,q;F KO vz;khwp xd;Wld; jrk vz; khwp xd;wpid vz;fzpj
nraw;ghl;bw;F cl;gLj;jg;gLk; NghJ ntspaPL jrk vz;zhf fhzg;gLk;
>>> y=4.0

>>> c=x/y

>>> print(c)

5.0

>>>

Note:-

igj;jdpy; vz;fis gpujpepjpj;Jtg;gLj;Jk; NghJ ntt;NtW mbfisf; nfhz;l vz;fisAk;


gpujpepjpj;Jtg;gLj;j KbAk;

vz; tiuaiw ngWkjp


,Ukvz; 0b11101 29
vz;kvz; 0o25 21
gjpdWk vz; 0x34 52

Example:-

>>> 0b111011+0b101

>>> 0xAB+0o12

>>> 0o75+0xAC

>>> 123+0b10000

>>> 23+0b1001+0o25+0x25

P.Bipunaath ICT 0757746217


2019 Batch

gy ngWkjpfis tiuaiw nra;jy; (Multiple Assignment)


 Mfpa ,uz;bw;Fk; xNu ngWkjpia toq;f (Assign) Ntz;Lkhdhy;
vd;wthW type nra;jy; Ntz;Lk;
vd toq;FtJ jtwhFk;
 vDk; NghJ ,Ds; 1k; ,Ds; k; ,Ds; John k;
toq;fg;gLk;

>>> x=8 >>> x,y=4,9 >>> k=8

>>> y=2 >>> print(x) >>> k=24

>>> print(x,y) >>> print(y) >>> print(k)

juT xd;wpid nra;epuypw;F (Program) cl;nrYj;Jk; Kiw

 nrhy; (String) xd;iw cs;sPL (Input) nra;Ak; NghJ

>>> a=input("Enter Your Name:")

Enter Your Name:Bipunaath

>>> print("My Name Is",a)

My Name Is Bipunaath

 ,yf;fk; (number) xd;wpid cs;sPL (input) nra;Ak; NghJ KO vz;zpw;F int k; jrk
vz;zpw;F float k; gad;gLj;jg;gLk;

>>> a=int(input("Enter Age:"))

Enter Age: 23

>>> b=float(input("Enter Marks:"))

Enter Marks: 25

>>> print (b)

25.0

Note:

cl;js;sy; (Indentation)

python ,y; white space Kf;fpakhdjhFk; Njitahd ,lq;fspy; kl;LNk whitespace ,ly; Ntz;Lk;
tab key gad;dLj;jg;gLk; ,J cl;js;sy; (indentation) vdg;gLk;

P.Bipunaath ICT 0757746217


2019 Batch

njhFjpfshf mike;j $w;Wf;fis ,izj;J fl;lq;fshf fhl;lg;gLjy; fl;likf;fg;gl;l nkhopfs;


(Block Structured Language) vdg;gLk;. ,jw;F Java vDk; nkhopapy; { } vDk; FwpaPL
gad;gLj;jg;gLk; igj;jdpy; cl;js;Sk; Kiw gad;dLj;jg;gLfpd;wJ.
milg;Gf;Fwp njhlf;f Ntz;ba re;ju;g;gj;jpy; njhlf;f tupapy; xU tab cl;js;sg;gLk;
milg;Gf;Fwp Kbtila Ntz;ba re;ju;g;gj;jpy; mLj;j tupapy; tab ,id ePf;fpAk; tiuaiw
nra;ag;gl;Ls;sJ

Conditional Statements

VjhtJ tplaq;fis cz;ik, ngha; vd Muha;e;J mtw;wpw;Fupa fl;lisfis ntspapLtjw;F ,J


gad;gLfpwJ

IF Condition

var = 100 Output:

if ( var == 100 ) :

print "Value of expression is 100"

else :

print "Condition"

Nested IF Condition

marks = 51 Output:
if ( marks >= 75 ) :

print "A"

elif (marks>=65) :

print"B"

elif (marks>=50) :

print "C"

elif (marks>=35) :

print "S"

else :

print "W"

P.Bipunaath ICT 0757746217


2019 Batch

Exercise:-

1. vDk; %d;W khwpfspw;F ngWkhdq;fs; ngWkhdq;fs; toq;fg;gl;Ls;sJ.


(have been assigned to three variables)
gpd;tUtdtw;wpw;Fupa tUtpisitf; fhz;f (find the value)
a. ( )
b. ( )
c. ( )
d. ( )

2. Output I fhz;f

j=10

y=4

if j<y or j!=4:

j-=y

print(j)

else:

y*=j

print(y)

3. Input Mf nry;rpa]; ,y; jug;gk; ntg;gepiyia guidl;Lf;F khw;Wtjw;fhd python coding


I vOJf

kPs; tUif (Loops, Loops, Loops……)


Fwpg;gpl;l xU mwpTWj;jy; njhliu my;yJ epfo;rr
; pia kPz;Lk; kPz;Lk; nraw;gLj;Jtjw;F gad;
gLj;jg;gLk; kPs;tUif (Loop) MFk;.

While loop
,q;F toq;fg;gLk; epge;jid rupahdjhf mikAk; NghJ Fwpg;gpl;l mwpTWj;jyhdJ kPz;Lk; kPz;Lk;
nraw;gLj;jg;gLk;

While loop MdJ gpd;tUk; tbtpy; mikAk;

while (condition):

Body Of while loop

P.Bipunaath ICT 0757746217


2019 Batch

Example:

a=0 Output:

while (a<10):

a=a+1

print a

sum = 0
Output:
i=0

while (i<10):

sum=sum+i

i=i+1

print (sum)

x=10
Output:
while (x!=0):

print(x)

x=x-1

x=1 Output:

a=1

while (x<=5):

a=a*x

x=x+1

print(a)

x=1
Output:
while (x<=10):

if(x%2==0):

print(x)

x=x+1

P.Bipunaath ICT 0757746217

You might also like