Comentários sobre powerpython https://powerpython.wordpress.com Just another WordPress.com site Tue, 10 Apr 2012 12:25:51 +0000 hourly 1 http://wordpress.com/ Comentário sobre Aula Python – Estrutura de Repetição 1 por Bruce Wayne https://powerpython.wordpress.com/2012/04/09/aula-python-estrutura-de-repeticao-1/#comment-97 Tue, 10 Apr 2012 12:25:51 +0000 http://powerpython.wordpress.com/?p=359#comment-97 Minha solução: http://hastebin.com/fenujijuki.py

]]>
Comentário sobre Aula Python – Estrutura de Repetição 1 por Zéar Oela https://powerpython.wordpress.com/2012/04/09/aula-python-estrutura-de-repeticao-1/#comment-96 Mon, 09 Apr 2012 22:05:43 +0000 http://powerpython.wordpress.com/?p=359#comment-96 num = -1
while num 10 or type(num) != int:
num = input(“digite um numero de 0 a 10 —> “)

]]>
Comentário sobre Aula Python – 19 – Estrutura de Decisão por Bruce Wayne https://powerpython.wordpress.com/2012/04/02/aula-python-19-estrutura-de-decisao/#comment-95 Mon, 02 Apr 2012 20:23:56 +0000 http://powerpython.wordpress.com/?p=351#comment-95 Você não tomou cuidado com os plurais e a formatação da saída (vírgulas, “e”, etc). Minha solução: http://hastebin.com/jocucusane.py

]]>
Comentário sobre Manipulando Strings com Python – 2 por Manipulando Strings com Python – 3 | powerpython https://powerpython.wordpress.com/2012/03/27/manipulando-strings-com-python-2/#comment-93 Thu, 29 Mar 2012 17:01:30 +0000 http://powerpython.wordpress.com/?p=344#comment-93 […] Continue lendo → Share this:TwitterFacebookGostar disso:GostoSeja o primeiro a gostar disso post. […]

]]>
Comentário sobre Aula Python – 18 – Estrutura de Decisão por Bruce Wayne https://powerpython.wordpress.com/2012/03/24/aula-python-18-estrutura-de-decisao/#comment-91 Sat, 24 Mar 2012 17:14:03 +0000 http://powerpython.wordpress.com/?p=328#comment-91 Em resposta a Bruce Wayne

Colei a versão errada. A certa é essa: http://hastebin.com/hipificahu.py

]]>
Comentário sobre Aula Python – 18 – Estrutura de Decisão por Bruce Wayne https://powerpython.wordpress.com/2012/03/24/aula-python-18-estrutura-de-decisao/#comment-90 Sat, 24 Mar 2012 17:12:28 +0000 http://powerpython.wordpress.com/?p=328#comment-90 Reescrevi seu programa. Acho que ficou mais legível e mais eficiente. Dá uma olhada: http://hastebin.com/dahadutoba.py

]]>
Comentário sobre Aula Python – 10 – Estrutura de Decisão por powerpython https://powerpython.wordpress.com/2012/03/09/aula-python-10-estrutura-de-decisao/#comment-86 Sat, 10 Mar 2012 12:10:08 +0000 http://powerpython.wordpress.com/?p=227#comment-86 Em resposta a Henrique

Obrigado pelo Comentário!! Já estou colocando um novo post com a sua solução!! Obrigado mesmo !!

]]>
Comentário sobre Aula Python – 10 – Estrutura de Decisão por Henrique https://powerpython.wordpress.com/2012/03/09/aula-python-10-estrutura-de-decisao/#comment-85 Sat, 10 Mar 2012 10:42:32 +0000 http://powerpython.wordpress.com/?p=227#comment-85 E ai powerpython! Acho q isso resolve o exercício 9:


# coding: utf-8
"""
>>> decrescente(1, 2, 3)
3
2
1
>>> decrescente(100, 101, 102)
102
101
100
>>> decrescente(1, 9, 3)
9
3
1
"""
def decrescente(*args):
"""
Função que ordena número da forma decrescente::
"""
numero = sorted(args, reverse=True)
print "\n".join(map(str, numero))
if __name__ == '__main__':
n1 = input("Digite o 1° numero: ")
n2 = input("Digite o 2° numero: ")
n3 = input("Digite o 3° numero: ")
decrescente(n1, n2, n3)

view raw

decrescente.py

hosted with ❤ by GitHub

]]>
Comentário sobre Aula Python – 7 – Estrutura de decisão por powerpython https://powerpython.wordpress.com/2012/03/06/aula-python-7-estrutura-de-decisao/#comment-84 Wed, 07 Mar 2012 12:01:38 +0000 http://powerpython.wordpress.com/?p=218#comment-84 Em resposta a Henrique Lopes

É isso ai Henrique, seu modo de resolver o exercício é bem interessante, parabéns!! Obrigado pelo comentário

]]>
Comentário sobre Aula Python – 7 – Estrutura de decisão por Henrique Lopes https://powerpython.wordpress.com/2012/03/06/aula-python-7-estrutura-de-decisao/#comment-83 Wed, 07 Mar 2012 11:37:20 +0000 http://powerpython.wordpress.com/?p=218#comment-83 Eu tenho acompanhado os seus post, e achei muito legal a sua iniciativa, continue assim!!
Eu resolvi fazer esse exercício de um modo mais pythônico, se refatorar ainda da para ficar melhor.


# coding:utf-8
"""
>>> maior(1, 2, 3)
3 é o maior número!!
>>> maior(1, 2, 4)
4 é o maior número!!
>>> maior(5,5,1)
5 é o maior!!
>>> maior(5,5,5)
todos o numeros são iguais
>>> menor(0, 1, 5)
0 é o menor número!!
>>> menor(-1, 1, 5)
-1 é o menor número!!
>>> menor(1, 5, 5)
1 é o menor número!!
>>> menor(5, 5, 5)
"""
def maior(*args):
"""
Função que informa o maior número digitado::
"""
quantidade = len(list(set(args)))
if quantidade == 1:
print 'todos o numeros são iguais'
elif quantidade == 2:
print max(args), 'é o maior!!'
else:
print max(args), "é o maior número!!"
def menor(*args):
"""
Função que informa o menor número digitado::
"""
if len(list(set(args))) > 1:
print min(args), "é o menor número!!"
if __name__ == '__main__':
n1 = input('Digite o 1° numero: ')
n2 = input('Digite o 2° numero: ')
n3 = input('Digite o 3° numero: ')
maior(n1, n2, n3)
menor(n1, n2, n3)

view raw

maior_menor.py

hosted with ❤ by GitHub

]]>