Jak sprawdzić, czy input to string w Pythonie

Przykłady kodu

4
0

N

def is_value_in_string(value: str, the_string: str):
    return value in the_string.lower()
2
0

N

try:
   val = int(userInput)
except ValueError:
   print("That's not an int!")

W innych językach

Ta strona jest w innych językach

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................