- Notifications
You must be signed in to change notification settings - Fork534
Rename folders and files#2
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
11 commits Select commitHold shift + click to select a range
02da7f2
rename for chp 1 - 9
somacdivad295e1cc
change ch10 filenames
somacdivade16f246
change ch12 filenames
somacdivaddb8a1d2
change ch13-14 filenames
somacdivad537c94d
change ch15 filenames
somacdivadef090e8
change ch16 filenames
somacdivad4da0ea3
rename appendix folders
somacdivadd9a39f4
ignore .vscode
somacdivadbe6521b
remove references to __main__
somacdivadce95c97
remove subfolders for alternate solutions
somacdivad89c6cbb
add alternate solutions with filename modifiers
somacdivadFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
3 changes: 2 additions & 1 deletion.gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -2,4 +2,5 @@ py3venv | ||
env | ||
*.pyc | ||
__pycache__/ | ||
.DS_Store | ||
.vscode |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 7 additions & 4 deletionschp01/1-1.py → ch02-getting-started/1-2-4.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletionsch02-getting-started/1-2-5.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# 1.2.5 - Store a Variable | ||
# Solutions to review exercies | ||
# Exercise 3 (exercises 1 and 2 are done in interactive window) | ||
# This solution works for Exercises 1 and 2 by typing the same lines into the | ||
# interactive window. | ||
# display a string directly | ||
print("hello") | ||
# display the contents of a string variable | ||
my_string = "hi" | ||
print(my_string) |
20 changes: 20 additions & 0 deletionsch04-fundamentals-strings-and-methods/1-4-0.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# 1.4 - Fundamentals: Strings and Methods | ||
# Solutions to review exercies | ||
# Exercise 1 | ||
print('There are "double quotes" in this string.') | ||
# Exercise 2 | ||
print("This string's got an apostrophe.") | ||
# Exercise 3 | ||
print('''This string was written on multiple lines, | ||
and it displays across multiple lines''') | ||
# Exercise 4 | ||
print("This one-line string was written out \ | ||
using multiple lines") |
8 changes: 6 additions & 2 deletionschp03/3-2.py → ...fundamentals-strings-and-methods/1-4-1.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
7 changes: 6 additions & 1 deletionchp03/3-3.py → ...fundamentals-strings-and-methods/1-4-2.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
# 1.4.2 - Use Objects and Methods | ||
# Solutions to review exercies | ||
# Exercise 1 | ||
# Take input from the user and display that input back | ||
my_input = input("Type something: ") | ||
print(my_input) | ||
# Exercise 2 | ||
# Display the input string converted to lower-case letters | ||
print(my_input.lower()) |
5 changes: 4 additions & 1 deletionchp03/first_letter.py → ...fundamentals-strings-and-methods/1-4-3.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletionchp04/4-1.py → ...undamentals-working-with-strings/1-5-0.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
15 changes: 13 additions & 2 deletionschp04/4-2.py → ...undamentals-working-with-strings/1-5-1.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,31 @@ | ||
# 1.5.1 - Streamline Your Print Statements | ||
# Solutions to review exercies | ||
# Exercise 1 | ||
weight = 0.2 | ||
animal = "newt" | ||
# Concatenate a number and a string in one print statement | ||
print(str(weight) + " kg is the weight of the newt.") | ||
# Exercise 2 | ||
# Use format() to print a number and a string inside of another string | ||
print("{} kg is the weight of the {}.".format(weight, animal)) | ||
# Exercise 3 | ||
# Use format() to add objects inside a string using index numbers | ||
# (Here we reversed the arguments - just because we could.) | ||
print("{1} kg is the weight of the {0}.".format(animal, weight)) | ||
# Exercise 4 | ||
# Use format() to print new objects inside a string | ||
print("{} kg is the weight of the {}.".format(0.2, "newt")) | ||
# Exercise 5 | ||
# Use formatted string literal to reference objects inside a string | ||
print(f"{weight} kg is the weight of the {animal}.") |
6 changes: 5 additions & 1 deletionchp04/4-3.py → ...undamentals-working-with-strings/1-5-2.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
# 1.5.2 - Find a String in a String | ||
# Solutions to review exercies | ||
# Exercise 1 | ||
# Cannot find the string "a" in the string "AAA": | ||
print("AAA".find("a")) | ||
# Exercise 2 | ||
# Try to find a number inside a string; | ||
# use str() to convert the number first | ||
version = "version 2.0" | ||
v_num = 2.0 | ||
print(version.find(str(v_num))) | ||
# Exercise 3 | ||
# Try to find an upper-case "X" in user input: | ||
my_input = input("Type something: ") | ||
print(my_input.find("X")) |
5 changes: 4 additions & 1 deletionchp04/translate.py → ...undamentals-working-with-strings/1-5-3.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletionchp05/exponent.py → ...fundamentals-functions-and-loops/1-6-1.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
11 changes: 8 additions & 3 deletionschp05/5-1.py → ...fundamentals-functions-and-loops/1-6-3.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
# 1.6.3 - Functions Summary | ||
# Solutions to review exercises | ||
# Exercise 1 | ||
def cube(num): | ||
"""Returnthe cube of the input number.""" | ||
cube_num = num * num * num | ||
return cube_num | ||
print("0 cubed is", cube(0)) | ||
print("2 cubed is", cube(2)) | ||
# Exercise 2 | ||
def multiply(num1, num2): | ||
"""Returnthe result of multiplying two input numbers.""" | ||
return num1 * num2 | ||
mult_result = multiply(2, 5) | ||
print("2 times 5 is", mult_result) |
7 changes: 5 additions & 2 deletionschp05/temperature.py → ...fundamentals-functions-and-loops/1-6-4.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
9 changes: 7 additions & 2 deletionschp05/5-2.py → ...fundamentals-functions-and-loops/1-6-5.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletionschp05/invest.py → ...fundamentals-functions-and-loops/1-6-6.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletionchp07/7-1.py → ch08-fundamentals-conditional-logic/1-8-1.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletionchp07/7-2.py → ch08-fundamentals-conditional-logic/1-8-2.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletionchp07/7-3.py → ch08-fundamentals-conditional-logic/1-8-3.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletionchp07/factors.py → ch08-fundamentals-conditional-logic/1-8-4.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletionchp07/7-4.py → ch08-fundamentals-conditional-logic/1-8-5.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletionchp07/7-5.py → ch08-fundamentals-conditional-logic/1-8-6.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# 1.8.6 - Recover From Errors | ||
# Solution to review exercises | ||
# Ask the user to enter an integer. | ||
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.