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")
821 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
565 PHP ssh2_scp_send fails to send files as intended
581 GDB gets version error when attempting to debug with the Presense SDK (IDE)
572 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.