@sidonduarte/

string-or-number

Python

Verifica se o valor é string ou numero

fork
loading
Files
  • main.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.5671821608041756","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"IyMjCiMgUmVzcG9zdGEgYSBTVE9wdDoKIyBodHRwczovL3B0LnN0YWNrb3ZlcmZsb3cuY29tL3EvMzQyMDMwLzc0MTIKIyBTaWRvbiAyMDE4CiMjIwp2YWxvcj0nMScKd2hpbGUgdmFsb3IhPScwJzoKICAgIHZhbG9yID0gaW5wdXQoJ0RpZ2l0ZSBvIHZhbG9yOicpCiAgICB0cnk6CiAgICAgICAgcHJpbnQoZmxvYXQodmFsb3IpLCcgw4kgdW0gbnVtZXJvJykKICAgIGV4Y2VwdCBWYWx1ZUVycm9yOgogICAgICAgIHByaW50KHZhbG9yLCAnw4kgdW1hIHN0cmluZycpCg=="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
###
# Resposta a STOpt:
# https://pt.stackoverflow.com/q/342030/7412
# Sidon 2018
###
valor='1'
while valor!='0':
    valor = input('Digite o valor:')
    try:
        print(float(valor),' É um numero')
    except ValueError:
        print(valor, 'É uma string')