<jupyter_start><jupyter_text>isOdd version 1.0<jupyter_code>def isOdd():
    
    print "This function will print a 0 if your number is even and a 1 if your number is odd."
    print "Note: this program does not handle 0's properly."
    check = input("What number would you like to check? :")
    output = check%2
    print output
isOdd()<jupyter_output><empty_output><jupyter_text>Conditions - back to temperature<jupyter_code>## Convert2.py

def temps():
    celsius = input("What is the Celsius temperature? ")
    fahrenheit = 9.0 / 5.0 * celsius + 32
    print "Temperature is", fahrenheit, "degrees fahrenheit."
    if fahrenheit >= 90:
        print "It's really hot out there, be careful!"
    if fahrenheit <= 30:
        print "Brrrrr. Be sure to dress warmly"

temps()<jupyter_output><empty_output><jupyter_text>Two-Way Decisions (isOdd)<jupyter_code>## is odd, v2.0
def isOdd():
    
    print "This function will print a 0 if your number is even and a 1 if your number is odd."
    print "Note: this program does not handle 0's properly."
    check = input("What number would you like to check?: ")
    output = check%2
    if output == 1:
        print "Your number is odd."
    else:
        print "Your number is even."
    
isOdd()<jupyter_output><empty_output><jupyter_text>Multi-Way Decisions (isOdd)<jupyter_code>## isOdd, v3.0
def isOdd():
    
    print "This function will tell you if your number is even or if it is odd."
    print "It will handle 0 differently."
    check = input("What number would you like to check?: ")
    output = check%2
    if check == 0:
        print "Your number is zero."
    elif output == 1:
        print "Your number is odd"
    else:
        print "Your number is even."
    
isOdd()<jupyter_output><empty_output><jupyter_text>Exception Handling<jupyter_code>##  isOdd, v 4.0
## This version handles exceptions
def isOdd():
    
    print "This function will print a 0 if your number is even and a 1 if your number is odd."
    try:
        check = input("What number would you like to check?: ")
        output = check%2
        if check == 0:
            print "Your number is zero."
        elif output == 1:
            print "Your number is odd"
        else:
            print "Your number is even."
    except NameError:
        print "You must enter a number, not a word.  Try again!"
    
isOdd()<jupyter_output><empty_output><jupyter_text>Multi-way Decisions (House or Senate)We will probably not have time to get to this, but in case you want to see code that I wrote for this problem:<jupyter_code>##eligible v1.0
def eligible():
    job = raw_input("Would you like to me a member of the Senate or the House?: ")
    job = job.lower()
    age = input("How old are you?: ")
    citizen = input("How many years have you been a citizen of the United States?: ")
    if job == "senate":
        if age >= 30:
            if citizen >= 9:
                print "You are eligible to be a Senator!"\
                      "If for some reason you want to be a Senator."
            else:
                print"You are ineligible to be a Senator -"
                "you must be citizen for 9 years."
        else:
            print "You can't be Senator - you are too young."\
                
    elif job == "house":
        if age >= 25:
            if citizen >= 7:
                print "You are eligible to be a member of the House! " \
                  "Although why you would want to be is anyone's guess."
            else:
                print "You are ineligible to be a member of the House -"
                "You must be a citizen for 7 years."
        else:
            print "You are ineligible to be a member of the House - "\
            "You are too young.  I know, they act like chidren, but they"
            " are technically all over the age of 25."
    else:
        print "That's not a job - try again!"
eligible()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09053916581892167, 'fraction_numerical': 0.012461851475076297, 'mean_word_length': 2.296730930427494, 'pattern_counts': {'":': 2, '<': 26, '<?xml version=': 0, '>': 30, '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': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '311768', 'license': 'CC0-1.0', 'n_tokens_mistral': 1216, 'n_tokens_neox': 1156, 'n_words': 497, 'path': 'lecture_05.ipynb', 'repo_name': 'ssdd3/methods1', 'size': '3932'}