1
0

python stuffz

This commit is contained in:
devenblake 2020-11-17 11:23:26 -05:00
parent e7d2dd1600
commit adfe462151

View File

@ -1,18 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<meta charset="US-ASCII">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Deven's Guide to Python</title>
</head>
<body>
<p><a href="..">~ Return</a></p>
<h1>Deven's Guide to Python</h1>
<h3>Updated 2020-06-04</h3>
<HTML lang="en">
<HEAD>
<META http-equiv="content-type" content="text/html; charset=windows-1252" />
<META charset="US-ASCII" />
<META NAME="viewport" CONTENT="width=device-width, initial-scale=1" />
<TITLE>Deven's Guide to Python</TITLE>
</HEAD>
<BODY>
<P><A HREF="/">~ Return</A></P>
<H1>Deven's Guide to Python</H1>
<H3>Updated 2020-11-17</H3>
<hr width="25%" size="1" align="left">
<h2>Table of contents</h2>
<HR width="25%" size="1" align="left" />
<H2>Table of contents</H2>
<p>
<b><a href="#introduction">What is Python?</a></b><br />
<b><a href="#installation">How to install Python</a></b><br />
@ -151,7 +151,8 @@ HELLO<br />
WORLD
</code></p>
<p>
You can also use the newline escape character, <code>\n</code>. This is similar to the <code>&lt;br /&gt;</code> tag in HTML.
You can also use the newline escape character, <code>\n</code>.
This is similar to the <code>&lt;br /&gt;</code> tag in HTML.
</p>
<p><code>print("HELLO\nWORLD")</code></p>
<p>Will return:</p>
@ -171,5 +172,28 @@ WORLD''')
HELLO<br />
WORLD
</code></p>
</body>
<H2 ID="functions">Functions</H2>
<P>
Functions are the most powerful part of any programming language.
In Python functions are themselves variables, with the type <code>&lt;class 'function'&gt;</code>.
In Python a very simple function we can study is the following:
</P>
<P><CODE>
def f():<BR />
&emsp; return
</CODE></P>
<P>
This function's name is <CODE>f</CODE> and it does everything after the line with <CODE>def</CODE> (so, just <CODE>return</CODE>).
That line with <CODE>def</CODE> is actually officially called a <I>function header</I>.
I think that's a stupid name personally, I just call it the "line with def" and everybody gets what I'm talking about.
</P>
<H3>def</H3>
<P>
<CODE>def</CODE> is a special thing in Python that <B>def</B>ines a function.
Y'know words in English? How do those work? I can say something is "cold",
but that structure of vowels and consonants isn't <I>cold</I> itself.
"Coldness" is a <I>function</I> that can be performed by matter under a specific circumstance,
namely, its particles having a below-average level of excitement.
</P>
</BODY>
</html>