a=[1, 'this','a',' ']
if str in a:
print(a)
I want to know if there's a string data type on the list Doesn't it come out if I do this?
python
a=[1, 'this','a',' ']
# If you want to know the element that is a string,
for s in filter(lambda i: isinstance(i, str), a):
print(s)
# If you just want to check if there is or not,
if any(isinstance(el, str) for el in a):
print(str(a) + " has a string")
775 GDB gets version error when attempting to debug with the Presense SDK (IDE)
864 Uncaught (inpromise) Error on Electron: An object could not be cloned
789 M2 Mac fails to install rbenv install 3.1.3 due to errors
1251 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2025 OneMinuteCode. All rights reserved.