A little more code docs updating.

This commit is contained in:
Josh Mudge 2018-12-15 16:50:20 -07:00
parent 07ecd3d237
commit 0dcb52765f
1 changed files with 10 additions and 0 deletions

View File

@ -121,6 +121,14 @@ If it uses dot notation like `.lower()`, it works exclusively on strings.
`"Ten times a cow is equal to " + result + " with 10 times as many breeding opportunities."` `"Ten times a cow is equal to " + result + " with 10 times as many breeding opportunities."`
or
`print(var, var2, var3)`
or
`string1 += string2`
## String Formatting with % ## String Formatting with %
`"%s %s - 2020" % (month, day) # Replace %s with a variable. First the month, then the day.` `"%s %s - 2020" % (month, day) # Replace %s with a variable. First the month, then the day.`
@ -163,6 +171,8 @@ total_cost = cucumbers * price_per_cucumber
print(total_cost) print(total_cost)
``` ```
`total_price += nice_sweater`
Cool concept from Ch2 Ex15: Cool concept from Ch2 Ex15:
``` ```