Created
October 23, 2018 21:18
-
-
Save israelgp24/8dd699735b3a71c70ac41420d696c5f1 to your computer and use it in GitHub Desktop.
TruthfulMadRobodoc created by Israel_EdgarEdg - https://repl.it/@Israel_EdgarEdg/Movistardatatalent2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Ingresamos el piso en la cual se encuentra Henry | |
| floor=input ('Indique en que piso se encuentra Henry: ') | |
| #Convertimos en entero el número. | |
| floor_number=int(floor) | |
| # Condicional para que los números ingresado esten entre -10^9≤ a ≤ 10^9 | |
| if floor_number <= 10**9 and floor_number >= -10**9 : | |
| #En el caso que el número sea negativo , lo volemos positivo y los convertimos en string. | |
| floor=str(abs(int(floor))) | |
| #Almacenamos las diferencias de cada número del piso con el número 8 | |
| list_ =[] | |
| numero_list=[] | |
| for i in floor: | |
| m=8-int(i) | |
| list_.append(int(m)) | |
| numero_list.append(int(i)) | |
| # Un condicional por si el número ingresado es negativo o positivo | |
| if floor_number>=0: | |
| i= list_[-1] | |
| if i== -1: | |
| subir=9 | |
| else : | |
| subir = i | |
| else : | |
| if floor_number <=-1 and -7<= floor_number: | |
| subir=8-floor_number | |
| else: | |
| i= list_[-1] | |
| if i== -1: | |
| subir=1 | |
| else : | |
| subir = -(i-10) | |
| for m in range(len(list_)): | |
| if list_[m]==0: | |
| subir=0 | |
| print (subir) | |
| else: | |
| print('Ingrese un número entre -10^9≤ a ≤ 10^9') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment