https://artofproblemsolving.com/wiki/api.php?action=feedcontributions&user=Pienotpi&feedformat=atomAoPS Wiki - User contributions [en]2024-03-29T15:33:57ZUser contributionsMediaWiki 1.31.1https://artofproblemsolving.com/wiki/index.php?title=AoPS_Wiki:Tutorial&diff=56687AoPS Wiki:Tutorial2013-07-21T10:57:09Z<p>Pienotpi: /* Math Questions */</p>
<hr />
<div>{{shortcut|[[A:T]]}}<br />
This '''AoPSWiki tutorial''' will help guide you through the process of learning to contribute to the [[AoPSWiki]]. Also see the categories [[:Category:AoPSWiki | AoPSWiki]] and [[:Category:Tutorials | Tutorials]] for more information on certain topics.<br />
<br />
In addition to the information below, there is a good [http://en.wikipedia.org/wiki/Help:Editing Wikipedia editing page] which contains most of the information below and will be incorporated into this tutorial over time.<br />
<br />
<br />
== Editing the AoPSWiki ==<br />
The AoPSWiki is meant to be edited by you, the users. If you ever find yourself saying that you could have done a better job on an article, we encourage you to do so! Before you can edit the article, however, you should make sure you are familiar with how the AoPSWiki works.<br />
<br />
=== Learning About AoPSWiki ===<br />
All users are encouraged to read up on what a [[wiki]] is and look around AoPSWiki. Click the [[Special:Random | Random Page]] button on the navigation panel at right a few times to get a feel for the structure of content in the AoPSWiki. Try clicking through a few of the colored links on some of the pages. Some will take you to other parts of the AoPSWiki and some will take you out of the AoPSWiki to other websites.<br />
<br />
Read about [[AoPSWiki:What makes AoPSWiki different|what makes AoPSWiki different]].<br />
<br />
=== Creating an Article ===<br />
If you search a topic or click on a link to an article that is not yet written, you yourself can begin creating that article. It is preferred to make bold the name of the article when it first appears in the article, particularly for terms that are given definitions. Bolding is explained in the Wiki Syntax section below. Read <url>Forum/viewtopic.php?p=553863#553863 Tips for Article Creation</url> to better understand the AoPSWiki philosophy of article content.<br />
<br />
If you can't think of a good topic to write about, look through the list of [[:Category:stubs|stubs]] for articles which already exist but have very little content.<br />
<br />
=== Editing an Article ===<br />
Click on the '''Edit''' button above an article while you are logged into the AoPSWiki. If the article is new, you can just start writing. If the article already exists, you will see the article text, [[MediaWiki]] syntax included. Write around or over the text to change the content of the article.<br />
<br />
If you would like to experiment with the Wiki format, please use the [http://en.wikipedia.org/wiki/Wikipedia:Sandbox Sandbox] to play around with new features.<br />
<br />
=== Wiki Syntax ===<br />
First, while in edit mode, there is a control panel in the upper left of the text box. Hover your cursor over the buttons to get an idea as to what they do. Remember that you can test syntax on your own user page. You can also hunt for examples by going into edit mode while in any article. Next, you can practice using wiki syntax in the [[sandbox]]. Here are a few common ways to format content in your article:<br />
* To create '''bullets''' link for this list, use the asterisk (*) at the beginning of each line.<br />
* Use the colon (:) to '''indent'''.<br />
* To ''italicize'' text, place two apostrophes both before and after the <nowiki>''text''</nowiki>.<br />
* To '''bold''' text, place three apostrophes both before and after the <nowiki>'''text'''</nowiki>.<br />
<br />
==== Internal Links ====<br />
Internal links are at the heart of what makes a wiki. Place two square brackets on each side of a word or phrase to link the text to the article of the same name. In order to create the link [[mathematics]], you would type <nowiki>[[mathematics]]</nowiki>. Also, for the cases when it is necessary to make the link-forming part of the phrase different from the actual title of the article it refers to, you may use the piped link format like in <nowiki>[[real number|reals]]</nowiki>, which will create a link to the article titled '''Real number''' but show and highlight the word '''reals''' instead. If you wish to refer to a specific section of an article, say that Natural Logarithm section of the Logarithm article, you use <nowiki>[[Logarithm#Natural Logarithm|natural logarithm]]</nowiki>, which comes out like this: [[Logarithm#Natural Logarithm|natural logarithm]].<br />
<br />
==== External Links ====<br />
When linking to information outside of the AoPSWiki, use external links. Begin with one open square bracket, type or paste the URL, add a space, then type the text that should appear naming the external link. For instance, to create a link to the [[MAA]] homepage ([http://www.maa.org Mathematical Association of America]), you should type <nowiki>[http://www.maa.org Mathematical Association of America]</nowiki>.<br />
<br />
When linking to any page on AoPS/[[MathLinks]], such as http://www.artofproblemsolving.com/viewtopic.php?t=217167 or http://www.mathlinks.ro/viewtopic.php?t=217167, do it like this:<br />
<nowiki><url>viewtopic.php?=217167 Vietnam test problem</url></nowiki><br />
It will look like this: <url>viewtopic.php?=217167 Vietnam test problem</url>.<br />
This way, people in Mathlinks will stay in Mathlinks, and people in the<br />
Art of Problem Solving will stay in the Art of Problem Solving.<br />
<br />
If you plan to add book links, please read [[AoPSWiki:Linking books]].<br />
<br />
==== Redirects ====<br />
If an article has several less standard names or acronyms, you can create a page (or pages) to direct users who find each one to the article name you chose. For instance, there is an article under [[ARML]] with the following text: <br><br />
<nowiki>#REDIRECT[[American Regions Mathematics League]]</nowiki>.<br><br />
If you click on the [[ARML]] link, you will go directly to the [[American Regions Mathematics League]] page. Very convenient!<br />
<br />
==== HTML ====<br />
AoPSWiki supports a limited, but highly useful amount of [[HTML]]. Try it out and see.<br />
<br />
{| border="0" cellpadding="5"<br />
| valign="top"|<br />
* &lt;b&gt;<br />
* &lt;big&gt;<br />
* &lt;blockquote&gt;<br />
* &lt;br&gt;<br />
* &lt;caption&gt;<br />
* &lt;center&gt;<br />
* &lt;cite&gt;<br />
* &lt;code&gt;<br />
* &lt;dd&gt;<br />
* &lt;div&gt;<br />
* &lt;dl&gt;<br />
* &lt;dt&gt;<br />
| valign="top"|<br />
* &lt;em&gt;<br />
* &lt;font&gt;<br />
* &lt;h1&gt;<br />
* &lt;h2&gt;<br />
* &lt;h3&gt;<br />
* &lt;h4&gt;<br />
* &lt;h5&gt;<br />
* &lt;h6&gt;<br />
* &lt;hr&gt;<br />
* &lt;i&gt;<br />
* &lt;li&gt;<br />
* &lt;ol&gt;<br />
| valign="top"|<br />
* &lt;p&gt;<br />
* &lt;pre&gt;<br />
* [http://www.w3.org/TR/1999/WD-ruby-19990322/ &lt;rb&gt;]<br />
* [http://www.w3.org/TR/1999/WD-ruby-19990322/ &lt;rp&gt;]<br />
* [http://www.w3.org/TR/1999/WD-ruby-19990322/ &lt;rt&gt;]<br />
* [http://www.w3.org/TR/1999/WD-ruby-19990322/ &lt;ruby&gt;]<br />
* &lt;s&gt;<br />
* &lt;small&gt;<br />
* &lt;strike&gt;<br />
* &lt;strong&gt;<br />
* &lt;sub&gt;<br />
* &lt;sup&gt;<br />
| valign="top"|<br />
* &lt;table&gt;<br />
* &lt;td&gt;<br />
* &lt;th&gt;<br />
* &lt;tr&gt;<br />
* &lt;tt&gt;<br />
* &lt;u&gt;<br />
* &lt;ul&gt;<br />
* &lt;var&gt;<br />
* &lt;!-- ... --&gt;<br />
|}<br />
<br />
=== Templates & Categories ===<br />
See the article [[template]]s and [[Help:Category|categories]] for a definitive guide on creating and using templates & categories, as well as a list of templates and categories currently in existence.<br />
<br />
== Finding articles to edit ==<br />
=== Red Links ===<br />
If, while reading through an article, you notice a red internal link, that represents an article that has not yet been written. Click on the red link to start writing that article. Remember, however, that the article on this subject may have already been written under a slightly different name, so it is always a good idea to make a little search first. If you find the relevant article under a different name, all you need to do is to create a simple REDIRECT page. You may also want to use this option if you feel that the right name for the topic should be somewhat different from the text in the red link. Also, don't forget to check the red link text for spelling and other errors before creating an article with the name from a red link.<br />
<br />
=== Recently Changed Articles ===<br />
At least while AoPSWiki is relatively young, recently changed articles are usually fairly new articles. You can find recently changed articles by clicking on the [[Special:Recentchanges]] (Recent Changes) link on the navigation tab at right. Go methodically through the articles, either contributing or adding broken links. Also see the [[AoPSWiki:Community_Portal]] (Community Portal).<br />
=== Wanted Pages ===<br />
The AoPSWiki automatically creates a list of [[Special:Wantedpages|wanted pages]]. These are pages to which there exist several links, but no actual page exists. This is a good place to look for articles which would contribute the most to the AoPSWiki's goodness.<br />
<br />
== Practice Good Netiquette ==<br />
* Absolutely no [[spam]] is permitted in the AoPSWiki.<br />
* Practice good [[Netiquette]].<br />
* Be aware of [[AoPSWiki:What AoPSWiki is not|What AoPSWiki is not]].<br />
<br />
== Where to Ask Questions ==<br />
=== AoPSWiki Forum ===<br />
The <url>Forum/index.php?f=416 AoPSWiki Forum</url> is a place to ask questions about AoPSWiki and its functionality when you cannot find the explanation in the AoPSWiki itself. Please read through the announcement and sticky threads to see if your questions are answered there. The forum also includes a search feature that might help you locate the answers to your questions.<br />
<br />
=== Article Discussion ===<br />
Click the '''Discussion''' tab at the top of an article to ask questions about an article or discuss its content.<br />
<br />
=== Math Questions ===<br />
The [[AoPS Forums]] are the appropriate places to ask questions about [[mathematics]], concepts, specific math problems, and [[problem solving]] (not the article discussion area).<br />
<br />
== AoPSWiki Pages ==<br />
Please read through the pages related to the AoPSWiki, linked through the category link below, in order to best understand how to use the AoPSWiki.<br />
<br />
<br />
<br />
[[Category:AoPSWiki|Tutorial]]</div>Pienotpihttps://artofproblemsolving.com/wiki/index.php?title=AoPS_Wiki:Tutorial&diff=56686AoPS Wiki:Tutorial2013-07-21T10:55:45Z<p>Pienotpi: /* Math Questions */</p>
<hr />
<div>{{shortcut|[[A:T]]}}<br />
This '''AoPSWiki tutorial''' will help guide you through the process of learning to contribute to the [[AoPSWiki]]. Also see the categories [[:Category:AoPSWiki | AoPSWiki]] and [[:Category:Tutorials | Tutorials]] for more information on certain topics.<br />
<br />
In addition to the information below, there is a good [http://en.wikipedia.org/wiki/Help:Editing Wikipedia editing page] which contains most of the information below and will be incorporated into this tutorial over time.<br />
<br />
<br />
== Editing the AoPSWiki ==<br />
The AoPSWiki is meant to be edited by you, the users. If you ever find yourself saying that you could have done a better job on an article, we encourage you to do so! Before you can edit the article, however, you should make sure you are familiar with how the AoPSWiki works.<br />
<br />
=== Learning About AoPSWiki ===<br />
All users are encouraged to read up on what a [[wiki]] is and look around AoPSWiki. Click the [[Special:Random | Random Page]] button on the navigation panel at right a few times to get a feel for the structure of content in the AoPSWiki. Try clicking through a few of the colored links on some of the pages. Some will take you to other parts of the AoPSWiki and some will take you out of the AoPSWiki to other websites.<br />
<br />
Read about [[AoPSWiki:What makes AoPSWiki different|what makes AoPSWiki different]].<br />
<br />
=== Creating an Article ===<br />
If you search a topic or click on a link to an article that is not yet written, you yourself can begin creating that article. It is preferred to make bold the name of the article when it first appears in the article, particularly for terms that are given definitions. Bolding is explained in the Wiki Syntax section below. Read <url>Forum/viewtopic.php?p=553863#553863 Tips for Article Creation</url> to better understand the AoPSWiki philosophy of article content.<br />
<br />
If you can't think of a good topic to write about, look through the list of [[:Category:stubs|stubs]] for articles which already exist but have very little content.<br />
<br />
=== Editing an Article ===<br />
Click on the '''Edit''' button above an article while you are logged into the AoPSWiki. If the article is new, you can just start writing. If the article already exists, you will see the article text, [[MediaWiki]] syntax included. Write around or over the text to change the content of the article.<br />
<br />
If you would like to experiment with the Wiki format, please use the [http://en.wikipedia.org/wiki/Wikipedia:Sandbox Sandbox] to play around with new features.<br />
<br />
=== Wiki Syntax ===<br />
First, while in edit mode, there is a control panel in the upper left of the text box. Hover your cursor over the buttons to get an idea as to what they do. Remember that you can test syntax on your own user page. You can also hunt for examples by going into edit mode while in any article. Next, you can practice using wiki syntax in the [[sandbox]]. Here are a few common ways to format content in your article:<br />
* To create '''bullets''' link for this list, use the asterisk (*) at the beginning of each line.<br />
* Use the colon (:) to '''indent'''.<br />
* To ''italicize'' text, place two apostrophes both before and after the <nowiki>''text''</nowiki>.<br />
* To '''bold''' text, place three apostrophes both before and after the <nowiki>'''text'''</nowiki>.<br />
<br />
==== Internal Links ====<br />
Internal links are at the heart of what makes a wiki. Place two square brackets on each side of a word or phrase to link the text to the article of the same name. In order to create the link [[mathematics]], you would type <nowiki>[[mathematics]]</nowiki>. Also, for the cases when it is necessary to make the link-forming part of the phrase different from the actual title of the article it refers to, you may use the piped link format like in <nowiki>[[real number|reals]]</nowiki>, which will create a link to the article titled '''Real number''' but show and highlight the word '''reals''' instead. If you wish to refer to a specific section of an article, say that Natural Logarithm section of the Logarithm article, you use <nowiki>[[Logarithm#Natural Logarithm|natural logarithm]]</nowiki>, which comes out like this: [[Logarithm#Natural Logarithm|natural logarithm]].<br />
<br />
==== External Links ====<br />
When linking to information outside of the AoPSWiki, use external links. Begin with one open square bracket, type or paste the URL, add a space, then type the text that should appear naming the external link. For instance, to create a link to the [[MAA]] homepage ([http://www.maa.org Mathematical Association of America]), you should type <nowiki>[http://www.maa.org Mathematical Association of America]</nowiki>.<br />
<br />
When linking to any page on AoPS/[[MathLinks]], such as http://www.artofproblemsolving.com/viewtopic.php?t=217167 or http://www.mathlinks.ro/viewtopic.php?t=217167, do it like this:<br />
<nowiki><url>viewtopic.php?=217167 Vietnam test problem</url></nowiki><br />
It will look like this: <url>viewtopic.php?=217167 Vietnam test problem</url>.<br />
This way, people in Mathlinks will stay in Mathlinks, and people in the<br />
Art of Problem Solving will stay in the Art of Problem Solving.<br />
<br />
If you plan to add book links, please read [[AoPSWiki:Linking books]].<br />
<br />
==== Redirects ====<br />
If an article has several less standard names or acronyms, you can create a page (or pages) to direct users who find each one to the article name you chose. For instance, there is an article under [[ARML]] with the following text: <br><br />
<nowiki>#REDIRECT[[American Regions Mathematics League]]</nowiki>.<br><br />
If you click on the [[ARML]] link, you will go directly to the [[American Regions Mathematics League]] page. Very convenient!<br />
<br />
==== HTML ====<br />
AoPSWiki supports a limited, but highly useful amount of [[HTML]]. Try it out and see.<br />
<br />
{| border="0" cellpadding="5"<br />
| valign="top"|<br />
* &lt;b&gt;<br />
* &lt;big&gt;<br />
* &lt;blockquote&gt;<br />
* &lt;br&gt;<br />
* &lt;caption&gt;<br />
* &lt;center&gt;<br />
* &lt;cite&gt;<br />
* &lt;code&gt;<br />
* &lt;dd&gt;<br />
* &lt;div&gt;<br />
* &lt;dl&gt;<br />
* &lt;dt&gt;<br />
| valign="top"|<br />
* &lt;em&gt;<br />
* &lt;font&gt;<br />
* &lt;h1&gt;<br />
* &lt;h2&gt;<br />
* &lt;h3&gt;<br />
* &lt;h4&gt;<br />
* &lt;h5&gt;<br />
* &lt;h6&gt;<br />
* &lt;hr&gt;<br />
* &lt;i&gt;<br />
* &lt;li&gt;<br />
* &lt;ol&gt;<br />
| valign="top"|<br />
* &lt;p&gt;<br />
* &lt;pre&gt;<br />
* [http://www.w3.org/TR/1999/WD-ruby-19990322/ &lt;rb&gt;]<br />
* [http://www.w3.org/TR/1999/WD-ruby-19990322/ &lt;rp&gt;]<br />
* [http://www.w3.org/TR/1999/WD-ruby-19990322/ &lt;rt&gt;]<br />
* [http://www.w3.org/TR/1999/WD-ruby-19990322/ &lt;ruby&gt;]<br />
* &lt;s&gt;<br />
* &lt;small&gt;<br />
* &lt;strike&gt;<br />
* &lt;strong&gt;<br />
* &lt;sub&gt;<br />
* &lt;sup&gt;<br />
| valign="top"|<br />
* &lt;table&gt;<br />
* &lt;td&gt;<br />
* &lt;th&gt;<br />
* &lt;tr&gt;<br />
* &lt;tt&gt;<br />
* &lt;u&gt;<br />
* &lt;ul&gt;<br />
* &lt;var&gt;<br />
* &lt;!-- ... --&gt;<br />
|}<br />
<br />
=== Templates & Categories ===<br />
See the article [[template]]s and [[Help:Category|categories]] for a definitive guide on creating and using templates & categories, as well as a list of templates and categories currently in existence.<br />
<br />
== Finding articles to edit ==<br />
=== Red Links ===<br />
If, while reading through an article, you notice a red internal link, that represents an article that has not yet been written. Click on the red link to start writing that article. Remember, however, that the article on this subject may have already been written under a slightly different name, so it is always a good idea to make a little search first. If you find the relevant article under a different name, all you need to do is to create a simple REDIRECT page. You may also want to use this option if you feel that the right name for the topic should be somewhat different from the text in the red link. Also, don't forget to check the red link text for spelling and other errors before creating an article with the name from a red link.<br />
<br />
=== Recently Changed Articles ===<br />
At least while AoPSWiki is relatively young, recently changed articles are usually fairly new articles. You can find recently changed articles by clicking on the [[Special:Recentchanges]] (Recent Changes) link on the navigation tab at right. Go methodically through the articles, either contributing or adding broken links. Also see the [[AoPSWiki:Community_Portal]] (Community Portal).<br />
=== Wanted Pages ===<br />
The AoPSWiki automatically creates a list of [[Special:Wantedpages|wanted pages]]. These are pages to which there exist several links, but no actual page exists. This is a good place to look for articles which would contribute the most to the AoPSWiki's goodness.<br />
<br />
== Practice Good Netiquette ==<br />
* Absolutely no [[spam]] is permitted in the AoPSWiki.<br />
* Practice good [[Netiquette]].<br />
* Be aware of [[AoPSWiki:What AoPSWiki is not|What AoPSWiki is not]].<br />
<br />
== Where to Ask Questions ==<br />
=== AoPSWiki Forum ===<br />
The <url>Forum/index.php?f=416 AoPSWiki Forum</url> is a place to ask questions about AoPSWiki and its functionality when you cannot find the explanation in the AoPSWiki itself. Please read through the announcement and sticky threads to see if your questions are answered there. The forum also includes a search feature that might help you locate the answers to your questions.<br />
<br />
=== Article Discussion ===<br />
Click the '''Discussion''' tab at the top of an article to ask questions about an article or discuss its content.<br />
<br />
=== Math Questions ===<br />
The [[AoPS Forum]]s are the appropriate places to ask questions about [[mathematics]], concepts, specific math problems, and [[problem solving]] (not the article discussion area).<br />
<br />
== AoPSWiki Pages ==<br />
Please read through the pages related to the AoPSWiki, linked through the category link below, in order to best understand how to use the AoPSWiki.<br />
<br />
<br />
<br />
[[Category:AoPSWiki|Tutorial]]</div>Pienotpihttps://artofproblemsolving.com/wiki/index.php?title=Getting_Started_With_Python_Programming&diff=56685Getting Started With Python Programming2013-07-21T10:51:24Z<p>Pienotpi: /* Installing Python */</p>
<hr />
<div>This guide takes you through the process of getting started with programming using the [[Python]] language. The sections flow from one to the next so it's recommended to read through this document in order from top to bottom.<br />
<br />
=Installing Python=<br />
<br />
Python is a computer language that is not compiled, but processed directly by your computer. It is by far a very useful and poupular language. Confusingly, Python has two "current" versions (2.7.3 and 3.3) and they are not fully compatible. We recommend using version 3.3. (This is the version that our [http://www.artofproblemsolving.com/School/courseinfo.php?course_id=cs:intro Introduction to Programming course] will be using.) Now, there is absloutly nothing wrong with 2.7.3, as it is what most of today's technolagy supports and uses. 3.3 is well on the way of replacing 2.7.3, so it will be more useful in a few years.<br />
<br />
Python is open-source software and is '''free''' to install and use. Here are installation instructions for Windows or Mac. (Linux users: you're essentially on your own -- go to http://www.python.org/download/releases/3.3.2/ and select the package that works best for you.)<br />
<br />
#Download the installer:<br />
#:* For x86 Windows (if you don't know which processor you have, use this one): click on the following link to download the installer: http://www.python.org/ftp/python/3.3.2/python-3.3.2.msi.<br />
#:* For x86-64 Windows: click on the following link to download the installer: http://www.python.org/ftp/python/3.3.2/python-3.3.2.amd64.msi.<br />
#:* For Mac OS X 10.6 and later: click on the following link to download the installer: http://www.python.org/ftp/python/3.3.2/python-3.3.2-macosx10.6.dmg.<br />
#:* For Mac OS X 10.5 and earlier: click on the following link to download the installer: http://www.python.org/ftp/python/3.3.2/python-3.3.2-macosx10.5.dmg.<br />
#:In either case, your browser should pop up a box asking you if you want to save the file. Click the "save file" option. Depending on how your browser is configured, you may be asked where to save the file. If this is the case, keep track of where you save the installer.<br />
#Find where the installer was downloaded and double click on it to run it. On most browsers, you should simply be able to double-click the installer from the browser's "downloads" window or menu. You may also have to click "Run" or "Yes" to a security window -- do this if necessary.<br />
#The setup wizard should launch. You should just click "Next" for every option in the setup wizard (i.e. use the defaults), unless you have some specific reason not to.<br />
#Familiarize yourself with the Python shell and IDLE text editor by running through the two sections below.<br />
<br />
=Using the Python Shell=<br />
The program that you'll use to run Python is called IDLE. It may be listed on your computer as "IDLE (Python GUI)". <br />
* On a Mac, IDLE should be in the Applications folder. <br />
* On Windows, IDLE should be accessible from the Start menu in a folder named "Python 3.2" (or something similar).<br />
The icon for IDLE looks something like this [[File:Idleicon.png]] or this [[File:Idleiconmac.png]]<br />
<br />
When you first open IDLE, you'll see the Python Shell (the numbers on your shell might be different than those shown below): <br />
<br />
[[File:Idle2-1.png]]<br />
<br />
(The screenshots in this article are taken using IDLE on a Mac with the font increased. Thus IDLE may look a little bit different for you but should still function similarly.)<br />
<br />
Note that the first line is the version of Python, which is 3.1.2 in the screenshot but should be 3.2 if you installed it as directed above. Another thing to note is that in the lower left hand corner of the Python Shell you can see that it says "Ln: 4 Col: 4". This is just telling you where in the document your cursor is. In this case it's on line 4 and over in column 4. (The line and column number may be slightly different for your installation.)<br />
<br />
The Python Shell is very useful for quick math and short sequences of commands:<br />
<br />
[[File:Idle2-2.2.png]]<br />
<br />
Here we see a number of familiar operations: + for addition, - for subtraction, * for multiplication, and / for division. The last operation shown in the example, denoted by **, happens to be exponentiation. One neat feature to note about Python is that it can store arbitrarily large numbers (limited by the amount of memory your computer has). Trying some hefty exponentiation, we can see that we can compute with some pretty big numbers such as <math>2^{1000}</math> as illustrated below.<br />
<br />
[[File:Idle2-3.png]]<br />
<br />
While Python can make for a pretty good calculator, it can do a whole lot more. One example is when dealing with strings as follows:<br />
<br />
[[File:Idle2-4.png]]<br />
<br />
Here we are concatenating the three strings "python", "is", and "cool" by using the + operator. Notice that previously we used + to add numbers but now with strings, Python concatenates them! You may also note that the output of the operation gives us a string with single quotes around it. In Python, you are able to use single quotes or double quotes to denote a string. You can use them interchangeably.<br />
<br />
As a final example, we can even write code in the Python Shell that extends beyond a single line as shown below. We also see our first example of a <math>\verb=for=</math> loop.<br />
<br />
[[File:Idle2-5.png]]<br />
<br />
As you type the above, the Python Shell will automatically indent the second line for you. To let the Python Shell know that you're done and are ready for it to run your code, you'll need to put in an extra blank line by hitting the Enter key again. At that point it should run your code and print your output.<br />
<br />
Take some time to play around with the Python Shell. You'll want to go through a more extensive introduction to programming to learn the full extent of what you can do with Python, but you can still do some pretty nifty stuff by just playing around. The Python Shell also has an extensive built-in help system -- just type '''help()''' at the ">>>" prompt to get started and then follow the instructions it gives you.<br />
<br />
=The IDLE Text Editor and Your First Python Program=<br />
For most programming needs, you'll want to edit your program in a separate document and then run it. Happily, IDLE comes with its own built-in text editor.<br />
<br />
To get started, go to the File menu of the Python Shell and click on "New Window". This should give you a blank document with the title "Untitled" as shown below:<br />
<br />
[[File:Idle2-6.png]]<br />
<br />
You'll need to save your file before running it, so you might as well save it now. Make sure that you name your file with a name that ends in .py, so that your computer knows it is a Python program. Here we save ours as test.py:<br />
<br />
[[File:Idle2-7.png]]<br />
<br />
To get acquainted with the text editor, let's write our first Python program! Let's write a program to the following task:<br />
<br />
'''Find the sum of all the positive multiples of 3 below 1000.'''<br />
<br />
We solve this by keeping a running total: we'll start with the smallest positive multiple of 3 and go up one multiple at a time keeping track of the sum, stopping once we hit 1000. We can do this with the following code:<br />
<br />
[[File:Idle2-8.png]]<br />
<br />
Notice that as you type the above code, the keywords ("while" and "print") will automatically get colored -- this makes the code easier to read. Also, after typing the line "while i < 1000:", the editor will automatically start indenting for you. When you get to the line "print(total)", you'll need to use the backspace key to remove the indentation. It is important that the code look exactly like it does in the screenshot above: in Python, proper indentation is very important!<br />
<br />
This program basically works by incrementing <math>\verb=i=</math> by 3 every time and adding it to the <math>\verb=total=</math>. The <math>\verb%+=%</math> notation might be intimidating at first. However, the statement <math>\verb%i+=3%</math> is just a shorthand for <math>\verb%i = i + 3%</math>.<br />
<br />
Now that we've written this code, we probably want to run it and test it out. We can do so by going to the Run menu and hitting Run Module (shortcut F5). The program should execute and print out the answer to the Python Shell:<br />
<br />
[[File:Idle2-9.png]]<br />
<br />
The RESTART line just means that Python is clearing all the work you've previously done before it starts running your program. Then, the program runs and we get our answer, 166833. If instead you get an error message or a different answer, check that your program exactly matches the screenshot above, and try it again.<br />
<br />
=What's Next?=<br />
<br />
Now that you've learned the very basics of getting Python going, there's a bunch of tutorials you can look at which are [http://wiki.python.org/moin/BeginnersGuide/NonProgrammers listed] on the Python website. Go check them out!</div>Pienotpihttps://artofproblemsolving.com/wiki/index.php?title=Decimal&diff=56684Decimal2013-07-21T04:18:43Z<p>Pienotpi: </p>
<hr />
<div>A decimal is a [[number]] that is not an [[integer]] while in neither fraction or percent form. The [[whole number]] is seperated remainder by a decimal point (.) which is identical to a period. For example, 3.5 wold equil 35/10 or 350%.<br />
<br />
{{stub}}<br />
[[Category:Definition]]</div>Pienotpihttps://artofproblemsolving.com/wiki/index.php?title=Decimal&diff=56683Decimal2013-07-21T04:14:51Z<p>Pienotpi: </p>
<hr />
<div>A decimal is a [[number]] that is not an [[integer]] while in neither fraction or percent form. The [[whole number]] is seperated remainder by a decimal point (.) which is identical to a period. For example, 3.5 wold equil 35/10 or 350%.<br />
<br />
{stub}</div>Pienotpihttps://artofproblemsolving.com/wiki/index.php?title=Decimal&diff=56682Decimal2013-07-21T04:13:16Z<p>Pienotpi: Created page with "A decimal is a numeber that is not an integer while in neither fraction or percent form. The whole number is seperated remainder by a decimal point (.) which is ident..."</p>
<hr />
<div>A decimal is a [[numeber]] that is not an [[integer]] while in neither fraction or percent form. The [[whole number]] is seperated remainder by a decimal point (.) which is identical to a period. For example, 3.5 wold equil 35/10 or 350%.</div>Pienotpihttps://artofproblemsolving.com/wiki/index.php?title=Fraction&diff=56681Fraction2013-07-21T04:05:18Z<p>Pienotpi: </p>
<hr />
<div>A '''fraction''' is the [[ratio]] of two [[number]]s. Most commonly, we consider [[rational number]]s, those fractions which are the ratio of two [[integer]]s or [[decimal]]s. For instance, <math>\frac 34</math> is such a fraction.<br />
<br />
{{stub}}<br />
[[Category:Definition]]</div>Pienotpihttps://artofproblemsolving.com/wiki/index.php?title=Fraction&diff=56680Fraction2013-07-21T04:04:43Z<p>Pienotpi: </p>
<hr />
<div>A '''fraction''' is the [[ratio]] of two [[number]]s. Most commonly, we consider [[rational number]]s, those fractions which are the ratio of two [[integer]]s or [[decimals]]. For instance, <math>\frac 34</math> is such a fraction.<br />
<br />
{{stub}}<br />
[[Category:Definition]]</div>Pienotpihttps://artofproblemsolving.com/wiki/index.php?title=Fraction&diff=56679Fraction2013-07-21T04:03:58Z<p>Pienotpi: </p>
<hr />
<div>A '''fraction''' is the [[ratio]] of two [[number]]s. Most commonly, we consider [[rational number]]s, those fractions which are the ratio of two [[integer]]s or [[decimal]]s. For instance, <math>\frac 34</math> is such a fraction.<br />
<br />
{{stub}}<br />
[[Category:Definition]]</div>Pienotpihttps://artofproblemsolving.com/wiki/index.php?title=Earth&diff=56678Earth2013-07-21T03:55:07Z<p>Pienotpi: /* Earth */</p>
<hr />
<div>== Earth ==<br />
<br />
Earth is the 3rd planet from the sun. Earth is home to millions of species of life, including humans. Earth is the only place in the universe known to sustain life. Earth was created around 4.5 billion years ago, and the first forms of life appeared within a billion years of today. Earth has one moon named Luna and orbits the sun, also known as Sol. It makes one orbit every 356 and 26/100 days.</div>Pienotpihttps://artofproblemsolving.com/wiki/index.php?title=Multiplication&diff=56677Multiplication2013-07-21T03:51:10Z<p>Pienotpi: </p>
<hr />
<div>In [[mathematics]], '''multiplication''' is a [[binary operation]] between two [[element]]s in a [[set]], in a broad sense. Depending on what set of [[element]]s are interacting, there are many types of multiplications with different properties. The multiplication sign is represented by the "x" or a medium sized dot.<br />
<br />
<br />
Multiplication is achieved by adding a number to itself as many times as the second number has value. For example, 4x4 would equil 4+4+4+4, which in turn equils 16.<br />
<br />
== Types of Multiplications ==<br />
* [[Ordinary Multiplication]]<br />
* Multiplication in [[modular arithmetic]]<br />
* [[Matrix Multiplication]]<br />
* [[Vector product]]s<br />
* [[Composition]] of functions<br />
* Multiplication with [[fraction]]s<br />
<br />
<br />
{{stub}}<br />
<br />
[[Category:Definition]]<br />
[[Category:Operation]]</div>Pienotpihttps://artofproblemsolving.com/wiki/index.php?title=Multiplication&diff=56676Multiplication2013-07-21T03:50:41Z<p>Pienotpi: </p>
<hr />
<div>In [[mathematics]], '''multiplication''' is a [[binary operation]] between two [[element]]s in a [[set]], in a broad sense. Depending on what set of [[element]]s are interacting, there are many types of multiplications with different properties. The multiplication sign is represented by the "x" or a medium sized dot.<br />
<br />
<br />
Multiplication is achieved by adding a number to itself as many times as the second number has value. For example, 4x4 would equil 4+4+4+4, which in turn equils 16.<br />
<br />
== Types of Multiplications ==<br />
* [[Ordinary Multiplication]]<br />
* Multiplication in [[modular arithmetic]]<br />
* [[Matrix Multiplication]]<br />
* [[Vector product]]s<br />
* [[Composition]] of functions<br />
* Multiplication with [[fractions]]<br />
<br />
<br />
{{stub}}<br />
<br />
[[Category:Definition]]<br />
[[Category:Operation]]</div>Pienotpihttps://artofproblemsolving.com/wiki/index.php?title=Multiplication&diff=56675Multiplication2013-07-21T03:48:33Z<p>Pienotpi: </p>
<hr />
<div>In [[mathematics]], '''multiplication''' is a [[binary operation]] between two [[element]]s in a [[set]], in a broad sense. Depending on what set of [[element]]s are interacting, there are many types of multiplications with different properties. The multiplication sign is represented by the "x" or a medium sized dot.<br />
<br />
<br />
Multiplication is achieved by adding a number to itself as many times as the second number has value. For example, 4x4 would equil 4+4+4+4, which in turn equils 16.<br />
<br />
== Types of Multiplications ==<br />
* [[Ordinary Multiplication]]<br />
* Multiplication in [[modular arithmetic]]<br />
* [[Matrix Multiplication]]<br />
* [[Vector product]]s<br />
* [[Composition]] of functions<br />
<br />
<br />
{{stub}}<br />
<br />
[[Category:Definition]]<br />
[[Category:Operation]]</div>Pienotpihttps://artofproblemsolving.com/wiki/index.php?title=Multiplication&diff=56674Multiplication2013-07-21T03:47:37Z<p>Pienotpi: </p>
<hr />
<div>In [[mathematics]], '''multiplication''' is a [[binary operation]] between two [[element]]s in a [[set]], in a broad sense. Depending on what set of [[element]]s are interacting, there are many types of multiplications with different properties. The multiplication sign is represented by the "x" or a medium sized dot.<br />
<br />
<br />
:Multiplication is achieved by adding a number to itself as many times as the second number has value. For example, 4x4 would equil 4+4+4+4, which in turn equils 16.<br />
<br />
== Types of Multiplications ==<br />
* [[Ordinary Multiplication]]<br />
* Multiplication in [[modular arithmetic]]<br />
* [[Matrix Multiplication]]<br />
* [[Vector product]]s<br />
* [[Composition]] of functions<br />
<br />
<br />
{{stub}}<br />
<br />
[[Category:Definition]]<br />
[[Category:Operation]]</div>Pienotpi