Você está na página 1de 4

Aula Phyton

Escopo global e local

X²-2x+4

def f(x):

return x**2-2*x+4

print (f(0))

f_1 = f(1)

def add _multi (n1,n2):

add= n1+n2

multi=n1*n2

add, multi = add_multi (2,5).

iInt (‘123’)

str (123)

+-*/

1+1=2

‘1’ +’1’ = ‘11’

‘1’ *5 = ‘11111’

[1,2] + [5] =

[1,2,5]

[1,2] * 2 =

[1,2,1,2]

{1,2} + {3} = {1,2,3}

{1,2} –{1} = {2}


Aula 02
def metro_para_cm(altura)

cent=altura *100

return cent

metro=metro_para_cm

nome = input (“Digite seu nome”)

Custo da dupla tarefa

TS= 1.2m/s

DT= 0,8m/s

EDT= (DT – TS)*100/TS

Def EDT (TS,DT):

EDT_AUX = 100*((DT-TS)/TS)

Return EDTt_AUX

def EDT (TS,DT):

EDT_AUX = 100*((DT-TS)/TS)

if (EDT_AUX) > 0:

Print (“Vantagem de DT”)

elif (EDT_AUX) < 0:

print (“Custo de DT”)

else:

print(“indiferente”)
DTs = [1.2, 1.3, 1.4, 1.5]

TSs = [ 1.3,1.5, 1.1, 1.5]

For i in range (4):

Print (EDT (TSs [i], DTs [i]))

Você também pode gostar