Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Metasyntactic variable
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Python=== [[Spam (food)|Spam]], [[ham]], and [[Egg (food)|eggs]] are the principal metasyntactic variables used in the [[Python programming language]].<ref>{{Cite web|url=https://docs.python.org/3/tutorial/|title=The Python Tutorial β Python 3.8.1 documentation|website=docs.python.org}}</ref> This is a reference to the famous comedy sketch, "[[Spam (Monty Python)|Spam]]", by [[Monty Python]], the eponym of the language.<ref>{{Cite web |date=2021-09-04 |title=General Python FAQ β Python 3.9.7 documentation |url=https://docs.python.org/3/faq/general.html |url-status=live |archive-url=https://web.archive.org/web/20210826153036/https://docs.python.org/3/faq/general.html#why-is-it-called-python |archive-date=2021-08-26 |access-date=2021-09-05 |website=docs.python.org |publisher=Python Software Foundation |at=Why is it called Python?}}</ref> In the following example <code>spam</code>, <code>ham</code>, and <code>eggs</code> are metasyntactic variables and lines beginning with <code>#</code> are comments. <syntaxhighlight lang="python"> # Define a function named spam def spam(): # Define the variable ham ham = "Hello World!" # Define the variable eggs eggs = 1 return </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)