Escolar Documentos
Profissional Documentos
Cultura Documentos
4
6
5
2
3
"populacaoA = 80000
crescimentoA = t
populacaoB = 200000
crescimentoB = 1.015
ano = 1
while (populacaoA <= populacaoB):
populacaoA *= crescimentoA
populacaoB *= crescimentoB
ano += 1
# Imprime o resultado
print 'Serao necessarios', ano, 'anos para que a populacao do pais A'\ ' ultrapasse a populacao
do pais B' "
Para que valor de "t" tem-se um loop infinito?
1.04
1.01
1.02
1.05
1.03
2e3
1e3
Todas as alternativas
1e2
Somente 1
include
plus
add
inclusive
import
i=4
while True:
if i%3 == 0:
break
print(i)
i+=1
1
Nenhuma das anteriores
Loop infinito
12
123
my_dict = {}
my_dict[1] = 1
my_dict['1'] = 2
my_dict[1.0] = 4
sum = 0
for k in my_dict:
sum += my_dict[k]
print (sum)
Erro de sintaxe.
6
7
4
3
def top():
if(q1.size()>0):
return q1.poll()
elif (q2.size()<0):
return q2.poll()
return 0
def top():
if(q1.size()>0):
return q1.peek()
elif (q2.size()>0):
return q2.peek()
return 0
def top():
if(q1.size()>0):
return q1.poll()
elif (q2.size()>0):
return q2.poll()
return 0
def top():
if(q1.size()>0):
return q1.peek()
elif (q2.size()<0):
return q2.peek()
return 0
def top():
if(q1.size()==0):
return q1.peek()
elif (q2.size()==0):
return q2.peek()
return 0;