Skip to content

Commit b9f9605

Browse files
Updated Print Module Code samples and readme
1 parent 5b4c496 commit b9f9605

14 files changed

Lines changed: 58 additions & 52 deletions

‎print/CodeToDebugWithPrintStatements.py‎

Lines changed: 0 additions & 12 deletions
This file was deleted.

‎print/HelloWorld.py‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎print/README.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,10 @@
33
The print function allows you to send output to the terminal
44

55
- [print](https://docs.python.org/3/library/functions.html#print)
6+
7+
The input function allows you to prompt a user for a value and store the value returned in a variable
8+
- [input](https://docs.python.org/3/library/functions.html#input)
9+
10+
Strings can be enclosed in single quotes or double quotes
11+
- "this is a string"
12+
- 'this is also a string'

‎print/SingleOrDoubleQuotes.py‎

Lines changed: 0 additions & 2 deletions
This file was deleted.

‎print/ask_for_input.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# The input funciton allows you to prompt the user for a value
2+
# You need to declare a variable to hold the value entered by the user
3+
name = input('What is your name? ')
4+
5+
print(name)

‎print/codeToDebug.py‎

Lines changed: 0 additions & 9 deletions
This file was deleted.

‎print/code_to_debug.py‎

Lines changed: 0 additions & 9 deletions
This file was deleted.

‎print/code_to_debug_withprint_statements.py‎

Lines changed: 0 additions & 12 deletions
This file was deleted.

‎print/coding_challenge.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Here's a challenge for you to help you practice
2+
# See if you can fix the code below
3+
4+
# print the message
5+
print('Why won't this line of code print')
6+
7+
# print the message
8+
prnit('This line fails too!')
9+
10+
# print the message
11+
print "I think I know how to fix this one"
12+
13+
# print the name entered by the user
14+
input('Please tell me your name: ')
15+
print(name)

‎print/coding_challenge_solution.py‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Here's a challenge for you to help you practice
2+
# See if you can fix the code below
3+
4+
# print the message
5+
# There was a single quote inside the string!
6+
# Use double quotes to enclose the string
7+
print("Why won't this line of code print")
8+
9+
# print the message
10+
# There was a mistake in the function name
11+
print('This line fails too!')
12+
13+
# print the message
14+
# Need to add the () around the string
15+
print ("I think I know how to fix this one")
16+
17+
# print the name entered by the user
18+
# You need to store the value returned by the input statement
19+
# in a variable
20+
name = input('Please tell me your name: ')
21+
print(name)

0 commit comments

Comments
 (0)