Ministério da Educação
Brasil um país de todos
Personal tools
Navigation
Log in


Forgot your password?
 
Document Actions

slides09-ex4.py

by Cicero Garrozi last modified 2015-10-09 06:02

Click here to get the file

Size 1 kB - File type text/python-source

File contents

def reverso2(y):
    x = y
    novo = 0
    while x > 0:
        ultimoDigito = x % 10
	x /= 10 #elimina o ultimo digito
	novo *= 10 #adiciona uma nova casa vazia no fim do novo
	novo += ultimoDigito #insere o numero na casa vazia
    return novo

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: