67415/how-to-convert-one-list-into-generator
I am new in generator concept. I tried to implement lazy execution concept. Can anyone help me with an example how to use list as a generator?
Hi@akhtar,
Say, you have one list A. Now convert this list into generator using iter function.
>>>A = [1,2,3,4,5,6] >>>gen = iter(A)
To check you can use next function.
>>>next(gen)
Hey, To split a string you can use ...READ MORE
Hi@akhtar, You need to import the NumPy module ...READ MORE
This should work: L = [1, 2, 3, ...READ MORE
You could try using the AST module. ...READ MORE
You can also use the random library's ...READ MORE
Syntax : list. count(value) Code: colors = ['red', 'green', ...READ MORE
Enumerate() method adds a counter to an ...READ MORE
You can simply the built-in function in ...READ MORE
Hi@akhtar, You can convert your dataframe into list. ...READ MORE
Hi@akhtar You can convert a dictionary dataset into ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.