Is there an expression for an infinite generator in Python?

0 votes
Is there a straight-forward generator expression that can yield infinite elements?

This is a purely theoretical question.
Nov 20, 2018 in Python by Anirudh
• 2,070 points
154 views

1 answer to this question.

0 votes

you can iterate over a callable returning a constant always different than iter()'s sentinel

g1=iter(lambda:0,1)
answered Nov 20, 2018 by Nymeria
• 3,520 points

Related Questions In Python

0 votes
0 answers

Is there any module in Python that I can use for Wiki markup?

Hi all, simple question. Is there any ...READ MORE

Jan 22 in Python by Anirudh
• 2,070 points
27 views
0 votes
0 answers

is therer an alternative for execfile in python?

can you give an example if there ...READ MORE

Apr 5 in Python by Waseem
• 4,480 points
62 views
0 votes
1 answer
0 votes
0 answers

What is the syntax for an empty while loop in python?

What kind of ambiguities are expected for ...READ MORE

Aug 5 in Python by Waseem
• 4,480 points
40 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 424 views
0 votes
1 answer

Need help extracting a schema to make use for an avro file in Python

Hi, nice question. So what I daily use ...READ MORE

answered Jan 10 in Python by Nymeria
• 3,520 points
679 views
0 votes
1 answer