A single line of Python's powerful features

Source: Internet
Author: User

The program that can print out its own code is called Quine.

Here is a line of Python quine:

_= ' _=%r;print _%%_ ';p rint _%_

Some people say that there is a semicolon does not count a line, no semicolon version:

Print (Lambda x:x+str ((x,))) (' Print (lambda x:x+str ((x,)) ') ')

In fact, if you use the name of the program language +quine as the keyword to search, you can find a variety of language implementation of the Quine. For advocates of various languages, it is important to write an elegant quine, similar to the fact that each new language implements a bootstrap (compiler, interpreter) in the language itself to be presentable.

If you think that writing a simple quine can satisfy programmers, you are too young:

Github-mame/quine-relay:an Uroboros program with programming languages

This repo implements a quine ring in 100 languages:

I'll ask you, do you abuse?

A single line of Python's powerful features

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.