<jupyter_start><jupyter_text>Module 1 Practice 1  Getting started with Python in Jupyter Notebooks notebooks, comments, print(), type(), addition, errors and art Student will be able to- use Python 3 in Jupyter notebooks- write working code using `print()` and `` comments  - write working code using `type()` and variables- combine strings using string addition (+)- add numbers in code (+)- troubleshoot errors- create character art   &nbsp;>**note:** the **[ ]** indicates student has a task to complete    >**reminder:** to run code and save changes: student should upload or clone a copy of notebooks  notebook use- [ ] insert a **code cell** below   - [ ] enter the following Python code, including the comment: ```python  [ ] print 'Hello!' and remember to save notebook!print('Hello!')```Then run the code - the output should be:  `Hello!`<jupyter_code>print("Hello!")<jupyter_output>Hello!<jupyter_text>run the cell below   - [ ] use **Ctrl + Enter**  - [ ] use **Shift + Enter**<jupyter_code>print('watch for the cat')<jupyter_output>watch for the cat<jupyter_text>Student's Notebook editing- [ ] Edit **this** notebook Markdown cell replacing the word "Student's" above with your name- [ ] Run the cell to display the formatted text- [ ] Run any 'markdown' cells that are in edit mode, so they are easier to read  [ ] convert \*this\* cell from markdown to a code cell, then run it  print('Run as a code cell')    commentscreate a code comment that identifies this notebook, containing your name and the date<jupyter_code>#<NAME> 2/6/2022<jupyter_output><empty_output><jupyter_text>use print() to - [ ] print [**your_name**]- [ ] print **is using python!**<jupyter_code># [ ] print your name
print("<NAME>")
# [ ] print "is using Python"
print("is using Python!")<jupyter_output><NAME>
is using Python!<jupyter_text>Output above should be:  `Your Name  is using Python!`    use variables in print()- [ ] create a variable **your_name** and assign it a string containing your name- [ ] print **your_name**<jupyter_code># [ ] create a variable your_name and assign it a sting containing your name
your_name = "<NAME>"
#[ ] print your_name

print(your_name)<jupyter_output><NAME><jupyter_text>create more string variables- **[ ]** create variables as directed below- **[ ]** print the variables<jupyter_code># [ ] create variables and assign values for: favorite_song, shoe_size, lucky_number
favorite_song = "Master of Puppets"
shoe_size = "12"
lucky_number = 11

# [ ] print the value of each variable favorite_song, shoe_size, and lucky_number
print(favorite_song)
print(shoe_size)
print(lucky_number)<jupyter_output>Master of Puppets
12
11<jupyter_text>use string addition- **[ ]**  print the above string variables (favorite_song, shoe_size, lucky_number) combined with a description by using **string addition**>for example favorite_song displayed as:  `favorite song is happy birthday`<jupyter_code># [ ] print favorite_song with description
print(favorite_song, "is a great song by Metallica.")

# [ ] print shoe_size with description
print("Wear a size",shoe_size,"shoe")

# [ ] print lucky_number with description
print("My lucky number is",lucky_number)<jupyter_output>Master of Puppets is a great song by Metallica.
Wear a size 12 shoe
My lucky number is 11<jupyter_text>more string addition- **[ ]** make a single string (sentence) in a variable called favorite_lucky_shoe using **string addition** with favorite_song, shoe_size, lucky_number variables and other strings as needed - **[ ]** print the value of the favorite_lucky_shoe variable string> sample output:  `For singing happy birthday 8.5 times, you will be fined $25`<jupyter_code># assign favorite_lucky_shoe using
print("playing",favorite_song,lucky_number,"times","will make you want to play it",shoe_size,"times")<jupyter_output>playing Master of Puppets 11 times will make you want to play it 12 times<jupyter_text>print() art  use `print()` and the asterisk **\*** to create the following shapes- [ ] diagonal line  - [ ] rectangle  - [ ] smiley face<jupyter_code># [ ] print a diagonal using "*"
print("     *")
print("    *")
print("   *")
print("  *")
print(" *")
print("*")

# [ ] rectangle using "*"
print("******")
print("*    *")
print("*    *")
print("*    *")
print("*    *")
print("******")

# [ ] smiley using "*"
print("   *   *")
print()
print("  *     *")
print("   *   *")
print("     *")<jupyter_output>*
    *
   *
  *
 *
*
******
*    *
*    *
*    *
*    *
******
   *   *

  *     *
   *   *
     *<jupyter_text>Using `type()`-**[ ]** calulate the *type* using `type()`<jupyter_code># [ ] display the type of 'your name' (use single quotes)
type('Matt')

# [ ] display the type of "save your notebook!" (use double quotes)

type("save your notebook!")
# [ ] display the type of "25" (use quotes)

type ('25')

# [ ] display the type of "save your notebook " + 'your name'

type ("save your notebook" + 'Matt')

# [ ] display the type of 25 (no quotes)


type (25)
# [ ] display the type of 25 + 10 


type (25 + 18)
# [ ] display the type of 1.55

type (1.55)

# [ ] display the type of 1.55 + 25


type (1.55 + 25)<jupyter_output><empty_output><jupyter_text>Find the type of variables- **[ ]** run the cell below to make the variables available to be used in other code- **[ ]** display the data type as directed in the cells that follow<jupyter_code># assignments ***RUN THIS CELL*** before starting the section

student_name = "Gus"
student_age = 16
student_grade = 3.5
student_id = "ABC-000-000"

# [ ] display the current type of the variable student_name

type (student_name)

# [ ] display the type of student_age


type (student_age)
# [ ] display the type of student_grade

type (student_grade)

# [ ] display the type of student_age + student_grade


type (student_age + student_grade)
# [ ] display the current type of student_id

type (student_id)

# assign new value to student_id 
student_id = "ABC-123-456"


# [ ] display the current of student_id
type (student_id)<jupyter_output><empty_output><jupyter_text>number integer addition- **[ ]** create variables (x, y, z) with integer values<jupyter_code># [ ] create integer variables (x, y, z) and assign them 1-3 digit integers (no decimals - no quotes)


x = 1
y = 11
z = 111<jupyter_output><empty_output><jupyter_text>- **[ ]** insert a **code cell** below- **[ ]** create an integer variable named **xyz_sum** equal to the sum of x, y, and z- **[ ]** print the value of **xyz_sum**<jupyter_code>xyz_sum = x + y + z
print(xyz_sum)<jupyter_output>123<jupyter_text>Errors- **[ ]** troubleshoot and fix the errors below<jupyter_code># [ ] fix the error 

print("Hello World!")    



# [ ] fix the error 
print("strings have quotes and variables have names")


# [ ] fix the error 
print("I have $" + "5")


# [ ] fix the error 
print("always save the notebook")<jupyter_output>always save the notebook<jupyter_text>ASCII art- **[ ]** Display first name or initials as ASCII Art- **[ ]** Challenge: insert an additional code cell to make an ASCII picture<jupyter_code># [ ] ASCII ART
print(chr(77)+chr(76))

# [ ] ASCII ART
# I am having trouble with this one!!<jupyter_output><empty_output><jupyter_text>Module 1 Practice 2 Strings: input, testing, formatting Student will be able to- gather, store and use string `input()`  - format `print()` output  - test string characteristics  - format string output  - search for a string in a string    input()getting input from users<jupyter_code># [ ] get user input for a variable named remind_me
remind_me = input()


# [ ] print the value of the variable remind_me
print(remind_me)


# use string addition to print "remember: " before the remind_me input string
print("remember",remind_me)<jupyter_output>remember today<jupyter_text>Program: Meeting Details [ ] get user **input** for meeting subject and time`what is the meeting subject?: plan for graduation`  `what is the meeting time?: 3:00 PM on Monday`   [ ] print **output** with descriptive labels  `Meeting Subject: plan for graduation`  `Meeting Time:    3:00 PM on Monday`<jupyter_code># [ ] get user input for 2 variables: meeting_subject and meeting_time
meeting_subject = input()
meeting_time = input()

# [ ] use string addition to print meeting subject and time with labels

print(meeting_subject,"at",meeting_time)<jupyter_output>Plan for a new dog at 3:00 PM on Friday<jupyter_text>print() formatting  combining multiple strings separated by commas in the print() function<jupyter_code># [ ] print the combined strings "Wednesday is" and "in the middle of the week" 

print("Wednesday is " + "in the middle of the week")
# [ ] print combined string "Remember to" and the string variable remind_me from input above

print("Remember to " + remind_me)
# [ ] Combine 3 variables from above with multiple strings

print(remind_me,meeting_subject,"at",meeting_time)<jupyter_output>today Plan for a new dog at 3:00 PM on Friday<jupyter_text>print() quotation marks<jupyter_code># [ ] print a string sentence that will display an Apostrophe (')


print("lets get Papa John's tonight")
# [ ] print a string sentence that will display a quote(") or quotes

print('"This is taking a while" - Matt')<jupyter_output>"This is taking a while" - Matt<jupyter_text>Boolean string tests  Vehicle tests   get user input for a variable named vehicle  print the following tests results  - check True or False if vehicle is All alphabetical characters using .isalpha()  - check True or False if vehicle is only All alphabetical & numeric characters  - check True or False if vehicle is Capitalized (first letter only)  - check True or False if vehicle is All lowercase  - **bonus** print description for each test (e.g.- `"All Alpha: True"`)<jupyter_code># [ ] complete vehicle tests 

car_type = input()
car_color = input()
print("I want a",car_type.isalpha(),"they come in an awesome",car_color)
print("'Toyota Truck' in car_type if lower used = ", 'Toyota Truck'.lower() in car_type.lower())


# [ ] print True or False if color starts with "b" 
print(car_color,"starts with b, so True")<jupyter_output>True starts with b, so True<jupyter_text>Sting formatting<jupyter_code># [ ] print the string variable capital_this Capitalizing only the first letter
capitalize_this = "the TIME is Noon."
print("the TIME is Noon.".capitalize())


# print the string variable swap_this in swapped case
swap_this = "wHO writes LIKE tHIS?"
print("wHO writes LIKE tHIS?".swapcase())

# print the string variable whisper_this in all lowercase
whisper_this = "Can you hear me?"
print("Can you hear me?".lower())
# print the string variable yell_this in all UPPERCASE
yell_this = "Can you hear me Now!?"
print("Can you hear me Now!?".upper())

#format input using .upper(), .lower(), .swapcase, .capitalize()
format_input = input('enter a string to reformat: ')
print(format_input.lower())<jupyter_output>i want this in all lower case<jupyter_text>input() formatting<jupyter_code># [ ] get user input for a variable named color
# [ ] modify color to be all lowercase and print

car_color = input()
print(car_color.lower())
# [ ] get user input using variable remind_me and format to all **lowercase** and print
# [ ] test using input with mixed upper and lower cases
remind_me = input()
print(remind_me.lower())

# [] get user input for the variable yell_this and format as a "YELL" to ALL CAPS
yell_this = "Yell"
print("I want to",yell_this.upper())<jupyter_output>I want to YELL<jupyter_text>"in" keyword boolean: short_str in long_str<jupyter_code># [ ] get user input for the name of some animals in the variable animals_input
animals_input = input()


# [ ] print true or false if 'cat' is in the string variable animals_input
print('cat' in animals_input)

# [ ] get user input for color
color_test = "Blue","BLUE","bLUE"

# [ ] print True or False for starts with "b"
print('b' in color_test)

# [ ] print color variable value exactly as input 
#     test with input: "Blue", "BLUE", "bLUE"<jupyter_output>False<jupyter_text>Program: guess what I'm reading short_str in long_str1. **[ ]** get user **`input`** for a single word describing something that can be read  save in a variable called **can_read**   e.g. - "website", "newspaper", "blog", "textbook"   &nbsp;  2. **[ ]** get user **`input`** for 3 things can be read   save in a variable called **can_read_things**  &nbsp;  3. **[ ]** print **`true`** if the **can_read** string is found   **in** the **can_read_things** string variable<jupyter_code># project: "guess what I'm reading"

# 1[ ] get 1 word input for can_read variable
can_read = "website"

# 2[ ] get 3 things input for can_read_things variable
can_read_things = "newspaper","blog","book"

# 3[ ] print True if can_read is in can_read_things
print("website" in can_read_things)

# [] challenge: format the output to read "item found = True" (or false)
# hint: look print formatting exercises<jupyter_output>False<jupyter_text>Program: Allergy Check1. **[ ]** get user **`input`** for categories of food eaten in the last 24 hours   save in a variable called **input_test**  2. **[ ]** print **`True`** if "dairy" is in the **input_test** string  3. **[ ]** Test the code so far  4. **[ ]** repeat the process checking the input for "nuts", **challenge** add "Seafood" and "chocolate"  5. **[ ]** Test your code    6. **[ ] challenge:** make your code work for input regardless of case, e.g. - print **`True`** for "Nuts", "NuTs", "NUTS" or "nuts"<jupyter_code># Allergy check 

# 1[ ] get input for test
input_test = input()

# 2/3[ ] print True if "dairy" is in the input or False if not
print("dairy" in input_test)

# 4[ ] Check if "nuts" are in the input
print("nuts" in input_test)
# 4+[ ] Challenge: Check if "seafood" is in the input
print("seafood" in input_test)

# 4+[ ] Challenge: Check if "chocolate" is in the input
print("chocolate" in input_test)<jupyter_output>True
True
False
False
{'fraction_non_alphanumeric': 0.1204871369892628, 'fraction_numerical': 0.009512142393889169, 'mean_word_length': 4.787322768974145, 'pattern_counts': {'":': 0, '<': 86, '<?xml version=': 0, '>': 90, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '25', 'dir': 'jupyter-structured-clean-dedup', 'id': '556996', 'license': 'MIT', 'n_tokens_mistral': 4561, 'n_tokens_neox': 4303, 'n_words': 1655, 'path': 'Python Absolute Beginner/Module_1.1_Practice.ipynb', 'repo_name': 'mlane52/pythonteachingcode', 'size': '13907'}