Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cond = False
- print('|CONTADOR DE CIFRAS|\n')
- while cond==False:
- opc=int(input('Opciones\n\n1. Contar cifras\n0. Salir\n\n<opcion>: '))
- if opc == 1:
- var1 = int(input('\nIngrese un numero entre 0 y 9.999: '))
- if var1>=1000 and var1<=9999:
- print('\nEl numero '+str(var1)+' tiene 4 cifras\n')
- elif var1>=100 and var1<=999:
- print('\nEl numero '+str(var1)+' tiene 3 cifras\n')
- elif var1>=10 and var1<=99:
- print('\nEl numero '+str(var1)+' tiene 2 cifras\n')
- else:
- print('\nEl numero '+str(var1)+' tiene 1 cifra\n')
- elif opc == 0:
- cond = True
- print('\nFin de la ejecucion\n')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement