Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Header Markup #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Print Formatting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#Print Formatting\n",
"# Print Formatting\n",
"\n",
"In this lecture we will briefly cover the various ways to format your print statements. As you code more and more, you will probably want to have print statements that can take in a variable into a printed string statement.\n",
"\n",
Expand Down Expand Up @@ -34,7 +34,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"##Strings\n",
"## Strings\n",
"You can use the %s to format strings into your print statements."
]
},
Expand Down Expand Up @@ -62,7 +62,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"##Floating Point Numbers\n",
"## Floating Point Numbers\n",
"Floating point numbers use the format %n1.n2f where the n1 is the total minimum number of digits the string should contain (these may be filled with whitespace if the entire number does not have this many digits. The n2 placeholder stands for how many numbers to show past the decimal point. Lets see some examples:"
]
},
Expand Down Expand Up @@ -165,7 +165,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"##Conversion Format methods.\n",
"## Conversion Format methods.\n",
"It should be noted that two methods %s and %r actually convert any python object to a string using two separate methods: str() and repr(). We will learn more about these functions later on in the course, but you should note you can actually pass almost any Python object with these two methods and it will work:\n"
]
},
Expand Down Expand Up @@ -211,7 +211,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"##Multiple Formatting\n",
"## Multiple Formatting\n",
"Pass a tuple to the modulo symbol to place multiple formats in your print statements:"
]
},
Expand All @@ -238,7 +238,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#Using the string .format() method\n",
"# Using the string .format() method\n",
"The best way to format objects into your strings for print statements is using the format method. The syntax is:\n",
"\n",
" 'String here {var1} then also {var2}'.format(var1='something1',var2='something2')\n",
Expand Down