List-With-Diff-Datatype

Sat 17 May 2025

import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: ml311; pyv: 3.11.10 (main, Oct  3 2024, 07:29:13) [GCC 11.2.0]'
print(pyu.ps2("haystack-ai ollama-haystack python-dotenv"))
haystack-ai==2.8.0
ollama-haystack is not installed in the current environment.
python-dotenv==1.0.1

lista = ["one", 2, "three", 4]
type(lista)
list
for item in lista:
    print(f"{item}, {type(item)}")
one, <class 'str'>
2, <class 'int'>
three, <class 'str'>
4, <class 'int'>


Score: 5

Category: basics