出力された文字列が数値変換可能かみる
S = input()
if S.isdecimal() == True:
print('YES')
else:
print('NO')
他にもあたえらえたのが全部数値か調べるということで
s = input()
if s.isdigit():
print("YES")
else:
print("NO")
Go to list of users who liked
出力された文字列が数値変換可能かみる
S = input()
if S.isdecimal() == True:
print('YES')
else:
print('NO')
他にもあたえらえたのが全部数値か調べるということで
s = input()
if s.isdigit():
print("YES")
else:
print("NO")
Register as a new user and use Qiita more conveniently
Go to list of users who liked