Jak sprawdzić, czy wartość ciąg znaków w pythonie

Przykłady kodu

13
0

N

isinstance(s, str)
7
0

N

if "blah" not in somestring: 
    continue
4
0

N

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

N

type('hello world') == str
# output: True

type(10) == str
# output: False

Podobne strony

Podobne strony do przykłady

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
..................................................................................................................