<jupyter_start><jupyter_text>Module 3 Conditionals - **`if`, `else`, `pass`**  - **Conditionals using Boolean String Methods**  - Comparison operators  - String comparisons----- > Student will be able to  - **control code flow with `if`... `else` conditional logic**    - **using Boolean string methods (`.isupper(), .isalpha(), startswith()...`)**    - using comparison (`>, =, <=, ==, !=`)    - using Strings in comparisons    &nbsp; Concepts Conditionals use `True` or `False` - **`if`** - **`else`**   - **`pass`**     [![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{"src":"http://jupyternootbookwams.streaming.mediaservices.windows.net/c53fdb30-b2b0-4183-9686-64b0e5b46dd2/Unit1_Section4.1-Conditionals.ism/manifest","type":"application/vnd.ms-sstr+xml"}],[{"src":"http://jupyternootbookwams.streaming.mediaservices.windows.net/c53fdb30-b2b0-4183-9686-64b0e5b46dd2/Unit1_Section4.1-Conditonals.vtt","srclang":"en","kind":"subtitles","label":"english"}])  Examples<jupyter_code>if True:
    print("True means do something")
else:
    print("Not True means do something else")
hot_tea = True

if hot_tea:
    print("enjoy some hot tea!")
else:
    print("enjoy some tea, and perhaps try hot tea next time.")
someone_i_know = False
if someone_i_know:
    print("how have you been?")
else:
    # use pass if there is no need to execute code 
    pass
# changed the value of someone_i_know
someone_i_know = True
if someone_i_know:
    print("how have you been?")
else:
    pass<jupyter_output>how have you been?<jupyter_text>Task 1 Conditionals Using Boolean with &nbsp; `if, else`- **Give a weather report using `if, else`**<jupyter_code>sunny_today = True
# [ ] test if it is sunny_today and give proper responses using if and else
if sunny_today:
    print("It sure is nice out!")
else:
    print("I could use some sunshine.")

sunny_today = False
# [ ] use code you created above and test sunny_today = False
if sunny_today:
    print("It sure is nice out!")
else:
    print("I could use some sunshine.")<jupyter_output>I could use some sunshine.<jupyter_text>&nbsp; Concepts Conditionals: Boolean String test methods  with `if`[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{"src":"http://jupyternootbookwams.streaming.mediaservices.windows.net/caa56256-733a-4172-96f7-9ecfc12d49d0/Unit1_Section4.1-conditionals-bool.ism/manifest","type":"application/vnd.ms-sstr+xml"}],[{"src":"http://jupyternootbookwams.streaming.mediaservices.windows.net/caa56256-733a-4172-96f7-9ecfc12d49d0/Unit1_Section4.1-conditonals-bool.vtt","srclang":"en","kind":"subtitles","label":"english"}])```pythonif student_name.isalpha():```  - **`.isalnum()`**- **`.istitle()`**- **`.isdigit()`**- **`.islower()`**- **`.startswith()`**  Examples<jupyter_code># review code and run cell
favorite_book = input("Enter the title of a favorite book: ")

if favorite_book.istitle():
    print(favorite_book, "- nice capitalization in that title!")
else:
    print(favorite_book, "- consider capitalization throughout for book titles.")
# review code and run cell
a_number = input("enter a positive integer number: ")

if a_number.isdigit():
    print(a_number, "is a positive integer")
else:
    print(a_number, "is not a positive integer")
    
# another if
if a_number.isalpha():
    print(a_number, "is more like a word")
else:
    pass
# review code and run cell
vehicle_type = input('"enter a type of vehicle that starts with "P": ')

if vehicle_type.upper().startswith("P"):
    print(vehicle_type, 'starts with "P"')
else:
    print(vehicle_type, 'does not start with "P"')<jupyter_output>"enter a type of vehicle that starts with "P": Ford
Ford does not start with "P"<jupyter_text>Task 2 Evaluating Boolean Conditionals  create evaluations for `.islower()`- print output describing **if** each of the 2 strings is all lower or not<jupyter_code>test_string_1 = "welcome"
test_string_2 = "I have $3"
# [ ] use if, else to test for islower() for the 2 strings
if test_string_1.islower():
    print("String 1 is lower case")
else:
    print("String 1 is not all lower case")
if test_string_2.islower():
    print("String 2 is lower case")
else:
    print("String 2 is not all lower case")<jupyter_output>String 1 is lower case
String 2 is not all lower case<jupyter_text>Task continued..  create a functions  using `startswith('w')`- w_start_test() tests if starts with "w"  **function should have a parameter for `test_string` and print the test result**<jupyter_code>test_string_1 = "welcome"
test_string_2 = "I have $3"
test_string_3 = "With a function it's efficient to repeat code"
# [ ] create a function w_start_test() use if & else to test with startswith('w')
def w_start_test(msg):
    if msg.lower().startswith('w'):
        print("This message starts with W")
    else:
        print("This message does not start with W")
# [ ] Test the 3 string variables provided by calling w_start_test()
w_start_test(test_string_1)
w_start_test(test_string_2)
w_start_test(test_string_3)<jupyter_output>This message starts with W
This message does not start with W
This message starts with W<jupyter_text>Module 3 Part 2 Conditionals - **`if`, `else`, `pass`**    - Conditionals using Boolean String Methods  - **Comparison operators**  - String comparisons----- > Student will be able to  - **control code flow with `if`... `else` conditional logic**    - using Boolean string methods (`.isupper(), .isalpha(), startswith()...`)    - **using comparison (`>, =, <=, ==, !=`)**    - using Strings in comparisons    &nbsp; Concepts   comparison operators  - **`>`** - **`<`** - **`>=`**, **`<=`** - **`==`** - Assign **`=`** vs compare **`==`** - **`!=`**  [![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{"src":"http://jupyternootbookwams.streaming.mediaservices.windows.net/cf192500-3879-4228-bd50-70dd3f38d831/Unit1_Section4.2-comparison-operators.ism/manifest","type":"application/vnd.ms-sstr+xml"}],[{"src":"http://jupyternootbookwams.streaming.mediaservices.windows.net/cf192500-3879-4228-bd50-70dd3f38d831/Unit1_Section4.2-comparison-operators.vtt","srclang":"en","kind":"subtitles","label":"english"}])  Examples<jupyter_code># [ ] review and run code to see if 3 greater than 5
3 > 5
# [ ] review and run code to see if 3 less than or equal to 5
3 <= 5
# [ ] review and run code 

# assign x equal to 3
x = 3

# test if x is equal to
x == 9
# [ ] review and run code 
x = 3
print("x not equal 9 is", x != 9)
print("x equal 3 is", x == 3)<jupyter_output>x not equal 9 is True
x equal 3 is True<jupyter_text>Task 3   comparison operators<jupyter_code>x = 9 + 4
# [ ] create a test to print() True or False for x is equal to 13
print(x==13)
# [ ] create a test to print True or False for 3 + 3 is greater than 2 + 4
print(3+3>2+4)<jupyter_output>False<jupyter_text>&nbsp; Concepts   Conditionals: comparison operators with `if`[![view video](https://iajupyterprodblobs.blob.core.windows.net/imagecontainer/common/play_video.png)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{"src":"http://jupyternootbookwams.streaming.mediaservices.windows.net/15e3b015-e83b-4ab8-8375-b11e52a348ea/Unit1_Section4.2-conditional-if.ism/manifest","type":"application/vnd.ms-sstr+xml"}],[{"src":"http://jupyternootbookwams.streaming.mediaservices.windows.net/15e3b015-e83b-4ab8-8375-b11e52a348ea/Unit1_Section4.2-conditional-if.vtt","srclang":"en","kind":"subtitles","label":"english"}])Comparison operators evaluate to Boolean **`True`** and **`False`** to direct the flow of **`if`** conditionals  Examples<jupyter_code># review code and run cell
x = 21
if x > 25:
    print("x is already bigger than 25")
else:
    print("x was", x)
    x = 25
    print("now x is", x)
# review code and run cell
x = 18
if x + 18 == x + x:
    print("Pass: x + 18 is equal to", x + x)
else:
    print("Fail: x + 18 is not equal to", x + x)
# review code and run cell. "!" means "not"
x = 18
test_value = 18
if x != test_value:
    print('x is not', test_value)
else:
    print('x is', test_value)

# review code and run cell
# DON'T ASSIGN (x = 2) when you mean to COMPARE (x == 2)
x = 2

if x == 2:
    print('"==" tests for, is equal to')
else:
    pass<jupyter_output>"==" tests for, is equal to<jupyter_text>Task 4   Evaluating a comparison operator in `if`<jupyter_code># [ ] create an if/else statement that tests if y is greater than or equal x + x 
# [ ] print output: "y greater than or equal x + x is" True/False ...or a similar output
x = 3
y = x + 8

if y >= x+x:
    print("y is greater than x+x")
else:
    print("y is not greater than x+x")<jupyter_output>y is greater than x+x<jupyter_text>Module 3 Part 3 Conditionals - **`if`, `else`, `pass`**  - Conditionals using Boolean String Methods  - Comparison operators  - **String comparisons**----- > Student will be able to  - **control code flow with `if`... `else` conditional logic**    - using Boolean string methods (`.isupper(), .isalpha(), startswith()...`)    - using comparison (`>, =, <=, ==, !=`)    - **using Strings in comparisons**    &nbsp; Concept String Comparisons-  Strings can be equal `==` or unequal `!=`-  Strings can be greater than `>` or less than `<` -  alphabetically `"A"` is less than `"B"`-  lower case `"a"` is greater than upper case `"A"`  Examples<jupyter_code># review and run code
"hello" < "Hello"
# review and run code
"Aardvark" > "Zebra"
# review and run code
'student' != 'Student'
# review and run code
print("'student' >= 'Student' is", 'student' >= 'Student')
print("'student' != 'Student' is", 'student' != 'Student')
# review and run code
"Hello " + "World!" == "Hello World!"<jupyter_output><empty_output><jupyter_text>Task 5 String Comparisons<jupyter_code>msg = "Hello"

# [ ] print the True/False results of testing if msg string equals "Hello" string
if msg == "Hello":
    print("msg == 'Hello' is ", msg == 'Hello')
greeting = "Hello"
# [ ] get input for variable named msg, and ask user to 'Say "Hello"'
# [ ] print the results of testing if msg string equals greeting string
msg = input('Say "Hello" ')

if msg == greeting:
    print("msg is equal to Hello")
else:
    pass<jupyter_output>Say "Hello" Hello
msg is equal to Hello<jupyter_text>&nbsp; Concept Conditionals: String comparisons with `if`[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{"src":"http://jupyternootbookwams.streaming.mediaservices.windows.net/d66365b5-03fa-4d0d-a455-5adba8b8fb1b/Unit1_Section4.3-string-compare-if.ism/manifest","type":"application/vnd.ms-sstr+xml"}],[{"src":"http://jupyternootbookwams.streaming.mediaservices.windows.net/d66365b5-03fa-4d0d-a455-5adba8b8fb1b/Unit1_Section4.3-string-compare-if.vtt","srclang":"en","kind":"subtitles","label":"english"}])  Examples<jupyter_code># [ ] review and run code
msg = "Save the notebook"

if msg.lower() == "save the notebook":
    print("message as expected")
else:
    print("message not as expected")
# [ ] review and run code
msg = "Save the notebook"
prediction = "save the notebook"

if msg.lower() == prediction.lower():
    print("message as expected")
else:
    print("message not as expected")<jupyter_output>message as expected<jupyter_text>Task 6 Conditionals: comparison operators with if<jupyter_code># [ ] get input for a variable, answer, and ask user 'What is 8 + 13? : '
# [ ] print messages for correct answer "21" or incorrect answer using if/else
# note: input returns a "string"
answer = input("What is 8 + 13 ")
if answer == "21":
    print("That is correct!")
else:
    print("I'm sorry.  That's incorrect.")<jupyter_output>What is 8 + 13 22
I'm sorry.  That's incorrect.<jupyter_text>Task 7   Program: True False Quiz FunctionCall the tf_quiz function with 2 arguments- T/F question string - answer key string like "T"  Return a string: "correct" or incorrect"[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{"src":"http://jupyternootbookwams.streaming.mediaservices.windows.net/3805cc48-f5c9-4ec8-86ad-1e1db45788e4/Unit1_Section4.3-TF-quiz.ism/manifest","type":"application/vnd.ms-sstr+xml"}],[{"src":"http://jupyternootbookwams.streaming.mediaservices.windows.net/3805cc48-f5c9-4ec8-86ad-1e1db45788e4/Unit1_Section4.3-TF-quiz.vtt","srclang":"en","kind":"subtitles","label":"english"}]) Define and use `tf_quiz()` function  - **`tf_quiz()`** has **2 parameters** which are both string arguments    - **`question`**: a string containg a T/F question like "Should save your notebook after edit?(T/F): "    - **`correct_ans`**: a string indicating the *correct answer*, either **"T"** or **"F"** - **`tf_quiz()`** returns a string:  "correct" or "incorrect"- Test tf_quiz(): **create a T/F question** (*or several!*) to **call tf_quiz()**<jupyter_code># [ ] Create the program, run tests
q_question = "T/F: The sky is blue "
q_answer = ("T")

def tf_quiz():
    u_answer = input(q_question)
    if u_answer.upper() == "T":
        print("You are correct!")
    else:
        print("I'm sorry.  That's not correct.")

tf_quiz()

q_question = "T/F: Grass is usually purple. "
q_answer = ("F")

def tf_quiz():
    u_answer = input(q_question)
    if u_answer.upper() == "F":
        print("You are correct!")
    else:
        print("I'm sorry.  That's not correct.")

tf_quiz()<jupyter_output>T/F: The sky is blue T
You are correct!
T/F: Grass is usually purple. F
You are correct!<jupyter_text>Module 3 Part 4 conditionals, type, and mathematics extended  - **conditionals: `elif`**- **casting**  - basic math operators  -----> Student will be able to  - **code more than two choices using `elif`** - **gather numeric input using type casting**  - perform subtraction, multiplication and division operations in code   &nbsp; Concepts conditional `elif`[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{"src":"http://jupyternootbookwams.streaming.mediaservices.windows.net/a2ac5f4b-0400-4a60-91d5-d350c3cc0515/Unit1_Section5.1-elif.ism/manifest","type":"application/vnd.ms-sstr+xml"}],[{"src":"http://jupyternootbookwams.streaming.mediaservices.windows.net/a2ac5f4b-0400-4a60-91d5-d350c3cc0515/Unit1_Section5.1-elif.vtt","srclang":"en","kind":"subtitles","label":"english"}]) a little review  - **`if`** means "**if** a condition exists then do some task." **`if`** is usually followed by **`else`**  - **`else`** means "**or else** after we have tested **if**, then do an alternative task"  When there  is a need to test for multiple conditions there is&nbsp; **`elif`**- **`elif`**&nbsp; statement follows &nbsp;**`if`**, and means **"else, if "** another condition exists do something else- **`elif`**&nbsp; can be used many times- **`else`**&nbsp; is used after the last test condition (**`if`** or **`elif`**) in psuedo code  **If** it is raining bring an umbrella  or **Else If** &nbsp;(`elif`) it is snowing bring a warm coat  or **Else** go as usual  Like **`else`**, the **`elif`** only executes when the previous conditional is False  Examples<jupyter_code># [ ] review the code then run testing different inputs
# WHAT TO WEAR
weather = input("Enter weather (sunny, rainy, snowy): ") 

if weather.lower() == "sunny":
    print("Wear a t-shirt")
elif weather.lower() == "rainy":
    print("Bring an umbrella and boots")
elif weather.lower() == "snowy":
    print("Wear a warm coat and hat")
else:
    print("Sorry, not sure what to suggest for", weather)
# [ ] review the code then run testing different inputs
# SECRET NUMBER GUESS
secret_num = "2"

guess = input("Enter a guess for the secret number (1-3): ")

if guess.isdigit() == False:
    print("Invalid: guess should only use digits")
elif guess == "1":
    print("Guess is too low")
elif guess == secret_num:
    print("Guess is right")
elif guess == "3":
    print("Guess is too high")
else:
    print(guess, "is not a valid guess (1-3)")<jupyter_output>Enter a guess for the secret number (1-3): 1
Guess is too low<jupyter_text>Task 8 Program: Shirt Sale Complete program using &nbsp; `if, elif, else`- Get user input for variable size (S, M, L)- reply with each shirt size and price (Small = \$ 6, Medium = \$ 7, Large = \$ 8)- if the reply is other than S, M, L, give a message for not available- *optional*: add additional sizes<jupyter_code># [ ] code and test SHIRT SALE

customer_size = input("What size shirt do you wear: Small, Medium, or large? ")

if customer_size.title() == "Small":
    print("A small shirt is $6.")
elif customer_size.title() == "Medium":
    print("A medium shirt is $8.")
elif customer_size.title() == "Large":
    print("A large shirt is $10.")
else:
    print("What are you trying to say to me right now?")<jupyter_output>What size shirt do you wear: Small, Medium, or large?large
A large shirt is $10.<jupyter_text>&nbsp; Concepts castingCasting is the conversion from one data type to another Such as converting from **`str`** to **`int`**.[![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{"src":"http://jupyternootbookwams.streaming.mediaservices.windows.net/4cbf7f96-9ddd-4962-88a8-71081d7d5ef6/Unit1_Section5.1-casting-input.ism/manifest","type":"application/vnd.ms-sstr+xml"}],[{"src":"http://jupyternootbookwams.streaming.mediaservices.windows.net/4cbf7f96-9ddd-4962-88a8-71081d7d5ef6/Unit1_Section5.1-casting-input.vtt","srclang":"en","kind":"subtitles","label":"english"}]) `int()`the **`int()`** function can convert stings that represent whole counting numbers into integers and strip decimals to convert float numbers to integers- `int("1") = 1` &nbsp; the string representing the integer character `"1"`, cast to a number - `int(5.1) = 5` &nbsp; the decimal (float), `5.1`, truncated into a non-decimal (integer)  - `int("5.1") = ValueError` &nbsp; `"5.1"` isn't a string representation of integer, `int()` can cast only strings representing integer values     Example<jupyter_code>weight1 = '60' # a string
weight2 = 170 # an integer
# add 2 integers
total_weight = int(weight1) + weight2
print(total_weight)<jupyter_output>230<jupyter_text>Task 9 casting with `int()` & `str()`<jupyter_code>str_num_1 = "11"
str_num_2 = "15"
int_num_3 = 10
# [ ] Add the 3 numbers as integers and print the result

int(str_num_1)+int(str_num_2)+int_num_3
str_num_1 = "11"
str_num_2 = "15"
int_num_3 = 10
# [ ] Add the 3 numbers as test strings and print the result

print(str_num_1 + str_num_2 + str(int_num_3))<jupyter_output>111510<jupyter_text>Task cont... Program: adding using `int` casting- **[ ]** initialize **`str_integer`** variable to a **string containing characters of an integer** (quotes)   - **[ ]** initialize **`int_number`** variable with an **integer value** (no quotes)- **[ ]** initialize **`number_total`** variable and **add int_number + str_integer** using **`int`** casting- **[ ]** print the sum (**`number_total`**)<jupyter_code># [ ] code and test: adding using int casting
str_integer = "2"
int_number = 10
number_total = int(str_integer) + int_number
print(number_total)<jupyter_output>12<jupyter_text>&nbsp; Concepts `input()`  strings that represent numbers can be "cast" to integer values  Example<jupyter_code># [ ] review and run code
student_age = input('enter student age (integer): ')
age_next_year = int(student_age) + 1
print('Next year student will be',age_next_year)
# [ ] review and run code
# cast to int at input
student_age = int(input('enter student age (integer): '))

age_in_decade = student_age + 10

print('In a decade the student will be', age_in_decade)<jupyter_output>enter student age (integer): 33
In a decade the student will be 43<jupyter_text>Task 10 Program: adding calculator- get input of 2 **integer** numbers - cast the input and print the input followed by the result  - Output Example: **`9 + 13 = 22`**  Optional: check if input .isdigit() before trying integer addition to avoid errors in casting invalid inputs<jupyter_code># [ ] code and test the adding calculator
str_num_1 = input("Give me a number ")
int_num_1 = int(str_num_1)
str_num_2 = input("Give me another number ")
int_num_2 = int(str_num_2)

print(int_num_1, "+", int_num_2, "=", int_num_1 + int_num_2)<jupyter_output>Give me a number 2
Give me another number 3
2 + 3 = 5<jupyter_text>Module 3 Part 5 conditionals, type, and mathematics extended- conditionals: `elif`  - casting   - **basic math operators**  -----> Student will be able to- code more than two choices using `elif`  - gather numeric input using type casting   - **perform subtraction, multiplication and division operations in code**   &nbsp; Concepts Math basic operators `+` addition `-` subtraction `*` multiplication `/` division  [![view video](https://openclipart.org/download/219326/1432343177.svg)]( http://edxinteractivepage.blob.core.windows.net/edxpages/f7cff1a7-5601-48a1-95a6-fd1fdfabd20e.html?details=[{"src":"http://jupyternootbookwams.streaming.mediaservices.windows.net/5bc97f7e-3015-4178-ac20-371a5302def1/Unit1_Section5.2-Math-operators.ism/manifest","type":"application/vnd.ms-sstr+xml"}],[{"src":"http://jupyternootbookwams.streaming.mediaservices.windows.net/5bc97f7e-3015-4178-ac20-371a5302def1/Unit1_Section5.2-Math-operators.vtt","srclang":"en","kind":"subtitles","label":"english"}])  Examples<jupyter_code># [ ] review and run example
print("3 + 5 =",3 + 5)
print("3 + 5 - 9 =", 3 + 5 - 9)
print("48/9 =", 48/9)
print("5*5 =", 5*5)
print("(14 - 8)*(19/4) =", (14 - 8)*(19/4))
# [ ] review and run example - 'million_maker'
def million_maker():
    make_big = input("enter a non-decimal number you wish were bigger: ")
    return int(make_big)*1000000

print("Now you have", million_maker())<jupyter_output>enter a non-decimal number you wish were bigger: 4
Now you have 4000000<jupyter_text>Task 11 use math operators to solve the set of tasks below<jupyter_code># [ ] print the result of subtracting 15 from 43
print(43-15)

# [ ] print the result of multiplying 15 and 43
print(15*43)

# [ ] print the result of dividing 156 by 12
print(int(156/12))

# [ ] print the result of dividing 21 by 0.5
print(21/.5)
# [ ] print the result of adding 111 plus 84 and then subtracting 45

print(111+84-45)
# [ ] print the result of adding 21 and 4 and then multiplying that sum by 4
print((21+4)*4)<jupyter_output>100<jupyter_text>Task 12 Program: Multiplying Calculator Function- define function **`multiply()`**, and within the function:  - gets user input() of 2 *strings* made of whole numbers  - cast the input to **`int()`**  - multiply the integers and **return** the equation with result as a **`str()`**    - **return** example      ```python     9 * 13 = 117     ```<jupyter_code># [ ] create and test multiply() function
def multiply():
    num_1 = input("Give me a number ")
    num_2 = input("Give me a number ")
    num_3 = int(num_1)
    num_4 = int(num_2)
    print("The product of", num_3, "and", num_4, "is", str(num_3 * num_4))
        
multiply()<jupyter_output>Give me a number 3
Give me a number 4
The product of 3 and 4 is 12<jupyter_text>Task 13 Project: Improved Multiplying Calculator Function putting together conditionals, input casting and math-  update the multiply() function to multiply or divide   - single parameter is **`operator`** with arguments of **`*`** or **`/`** operator  - default operator is "*" (multiply)  - **return** the result of multiplication or division  - if operator other than **`"*"`** or **`"/"`**  then **` return "Invalid Operator"`**<jupyter_code># [ ] create improved multiply() function and test with /, no argument, and an invalid operator ($)
def multiply():
    num_1 = input("First Number ")
    operator = input("/ or *")
    num_2 = input("Second Number ")
    num_3 = int(num_1)
    num_4 = int(num_2)
    if operator == "/":
        print(num_3/num_4)
    elif operator == "*":
        print(num_3*num_4)
    else:
        print("Invalid Operator")
multiply()<jupyter_output>First Number 3
/ or *
Second Number 4
Invalid Operator<jupyter_text>Task 14 Fix the Errors<jupyter_code># Review, run, fix 
student_name = input("enter name: ").capitalize()
if student_name.startswith("F"):
    print(student_name,"Congratulations, names starting with 'F' get to go first today!")
elif student_name.startswith("G"):
    print(student_name,"Congratulations, names starting with 'G' get to go second today!")
else:
    print(student_name, "please wait for students with names staring with 'F' and 'G' to go first today.")<jupyter_output>enter name: greg
Greg Congratulations, names starting with 'G' get to go second today!
{'fraction_non_alphanumeric': 0.14937742882068364, 'fraction_numerical': 0.0425489729558252, 'mean_word_length': 4.822904640960517, 'pattern_counts': {'":': 71, '<': 88, '<?xml version=': 0, '>': 98, 'https://': 9, 'lorem ipsum': 0, 'www.': 0, 'xml': 9}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '26', 'dir': 'jupyter-structured-clean-dedup', 'id': '166849', 'license': 'MIT', 'n_tokens_mistral': 9273, 'n_tokens_neox': 8540, 'n_words': 2494, 'path': 'Python Absolute Beginner/Module_3.0_Tutorials_Conditionals.ipynb', 'repo_name': 'smcreset/pythonteachingcode', 'size': '25218'}