renix1

find numbers in string with 3 lines

Dec 15th, 2016
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.20 KB | None | 0 0
  1. x = '1234567890'
  2. z = input("Digite um número: ")
  3. n = x.find(z);print("O número que você estava procurando está no índice %d e é o número %s" % (n, x[n])) if z in x else print('Não achamos!\n')
Advertisement
Add Comment
Please, Sign In to add comment