0% found this document useful (0 votes)
9 views5 pages

Introdvction Py Progra: To Thon Mning

The document discusses Python programming concepts including taking user input as floats, using format strings, and writing functions to calculate the perimeter of polygons and convert between Celsius and Fahrenheit temperatures.

Uploaded by

Jopet Ramos
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)
9 views5 pages

Introdvction Py Progra: To Thon Mning

The document discusses Python programming concepts including taking user input as floats, using format strings, and writing functions to calculate the perimeter of polygons and convert between Celsius and Fahrenheit temperatures.

Uploaded by

Jopet Ramos
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

TECHNOLOGICAL UNVERSITY OF THE PHILIPPINES

COLLEGt OF ENGINEERING
DEPARTMENT
MECHAN/CAL ENG INEERIMG

MODUL E NO 1
Introdvction to Py thon Progra mning

CORONEL,Lemvel B.
BSME-1B

June 09, 2023


Engr. JohnPeter M.Ramos
Instructor
PLOGR AMMINS DEMD 1.2

1.)1pe te follouing ede ongo Gthon serpt


kÍ=float(intpt te vabe of te first esistor: )
1 resltor: ))
R2=fbat(aptaot the valve ot te second
2.
3.

s. RT- parallel=1/(1R1+1/R2)

(2T series), 'nd the totsl resistamie iaalel is\


9.2} phms'. format (RTpnalle1D)
10.

2.)kn the code and


L
3.) Whet does te float com nnd do on he statements on hc
emd ine 2?
- The fbt tunetion ís vsed to coybert he bser input
htch is seing, oto a floatiny -point nun ber
) / lia s and G, tny changing koth Ci.2 to li.3f3.
Wlat hapens whe run e
The decfn ea valve of the first and seion d
resístoy will be ckany ed iato 3 deal places'
and be rounded off, inc te d of Z decinalplaces.
P2ORAMMI% DEMO 2
7)

1 frst Nane jinput (Enter Fiect Namei )


2 lastNynt ihput(Euter last Nermti
3-seetion =input('Enter Yeur and Seetron: )
4.
5. priat (Welcome (13, (0} and (2} !! forat (hirstName,\
C. Jastfrne, Seetlon))
7.

3)/ lines Y, what is the


the code ? what hanpens wen gou reareng e fen
he end
ruy tle prgam gin.
- the
iasert le formet that is gren and if here is
num ber to that just hke 2, [13 4nd (o3, the
order of ie given 3 t4ings inside the format wil
be avtoy ticaly crranged fron let to rig4t rrom
the format nd from ovest to greatest froy the

"BSME-18, Corone/ nd leme/" i we folo w the


giey formnt(Le mel, Corone) 854E -I3),
feoblen 1

polsgon hus
Jengtt S.

of he polygon
Wte apreg re caled cale-polygos thaf akesandtho hearquments,
perimeter
to four dunlees.
of a gien egar polygon roundeodof
1o-floatlatl'at he h.-ler f silegi ) )
each sidei )
2s =float (rsput(iput te lenyth or
3

,Pin's
print('Ke
Problem
celstofuhrenheit
Woite on proqramn ca lled
eperuture,
which prronpts e ser tor a celsis t
conert he temetne to fuhrenseit, nd piat at
fhe conicted teperatue.
Celeis. ))
1 Cefloatinpt ('input the temerutre ia degree
2
3 f=(C*/5) + 32
4

5 print ( The t }° Celsrs . fonmat (), \ ())


's cgual to (3°Fakrenseit' forat

You might also like