Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Post History

50%
+0 −0
Challenges Getting perfect squares, differently

Python 3, 34 bytes x=0;y=1 while 1:x+=y;print(x);y+=2 Try it online! 1 is the int equivalent to True, which helps save bytes.

posted 2y ago by General Sebast1an‭  ·  edited 2y ago by General Sebast1an‭

Answer
#2: Post edited by user avatar General Sebast1an‭ · 2021-08-12T13:27:32Z (over 2 years ago)
  • # [Python 3], 34 bytes
  • <!-- language-all: lang-python -->
  • x=0;y=1
  • while 1:x+=y;print(x);y+=2
  • [Try it online!][TIO-ks8ybt8n]
  • [Python 3]: https://docs.python.org/3/
  • [TIO-ks8ybt8n]: https://tio.run/##K6gsycjPM/7/v8LWwLrS1pCrPCMzJ1XB0KpC27bSuqAoM69Eo0LTulLb1uj/fwA "Python 3 – Try It Online"
  • # [Python 3], 34 bytes
  • <!-- language-all: lang-python -->
  • x=0;y=1
  • while 1:x+=y;print(x);y+=2
  • [Try it online!][TIO-ks8ybt8n]
  • `1` is the `int` equivalent to `True`, which helps save bytes.
  • [Python 3]: https://docs.python.org/3/
  • [TIO-ks8ybt8n]: https://tio.run/##K6gsycjPM/7/v8LWwLrS1pCrPCMzJ1XB0KpC27bSuqAoM69Eo0LTulLb1uj/fwA "Python 3 – Try It Online"
#1: Initial revision by user avatar General Sebast1an‭ · 2021-08-12T13:23:11Z (over 2 years ago)
# [Python 3], 34 bytes

<!-- language-all: lang-python -->

    x=0;y=1
    while 1:x+=y;print(x);y+=2

[Try it online!][TIO-ks8ybt8n]

[Python 3]: https://docs.python.org/3/
[TIO-ks8ybt8n]: https://tio.run/##K6gsycjPM/7/v8LWwLrS1pCrPCMzJ1XB0KpC27bSuqAoM69Eo0LTulLb1uj/fwA "Python 3 – Try It Online"