<commit_before>#!/usr/bin/env python

""" Assignment 1, Exercise 3, INF1340, Fall, 2015. Troubleshooting Car Issues.

This module contains one function diagnose_car(). It is an expert system to
interactive diagnose car issues.

"""

__author__ = '<NAME>'
__email__ = "<EMAIL>"
__copyright__ = "2015 <NAME>"
__license__ = "MIT License"


def diagnose_car():
    """
    Interactively queries the user with yes/no questions to identify a
    possible issue with a car.

    Inputs: Y/N

    Expected Outputs: troubleshooting message

    Errors: when inputting answers other than y/n

    """

    answer = raw_input("Is the car silent when you turn the key? ")

    if answer == "y":
        answer = raw_input("Are the battery terminals corroded? ")
        if answer == "y":
            print("Clean terminals and try starting again.")
        if answer == "n":
            print("Replace cables and try again.")
        else:
            print("Please input y/n answer only.")
    if answer == "n":
        answer = raw_input("Does the car make a clicking noise? ")
        if answer == "y":
            print("Replace the battery.")
        if answer == "n":
            answer = raw_input("Does the car crank up but fail to start? ")
            if answer == "y":
                print("Check spark plug connections.")
            if answer == "n":
                answer = raw_input("Does the engine start and then die? ")
                if answer == "y":
                    answer = raw_input("Does your car have fuel injection? ")
                    if answer == "y":
                        print("Get it in for service.")
                    if answer == "n":
                        print("Check to ensure the choke is opening and closing.")
                    else:
                        print("Please input y/n answer only.")
                if answer == "n":
                    print("Engine is not getting enough fuel. Clean fuel pump.")

# Add error message when input is not y/n
                    Ad

    return

diagnose_car()<commit_msg>Fixed. Need to add comments.<commit_after>#!/usr/bin/env python

""" Assignment 1, Exercise 3, INF1340, Fall, 2015. Troubleshooting Car Issues.

This module contains one function diagnose_car(). It is an expert system to
interactive diagnose car issues.

"""

__author__ = '<NAME>'
__email__ = "<EMAIL>"
__copyright__ = "2015 <NAME>"
__license__ = "MIT License"


def diagnose_car():
    """
    Interactively queries the user with yes/no questions to identify a
    possible issue with a car.

    Inputs: Y/N

    Expected Outputs: troubleshooting message

    Errors: when inputting answers other than y/n

    """

    answer = raw_input("Is the car silent when you turn the key? ")

    if answer == "Y":
        answer = raw_input("Are the battery terminals corroded? ")
        if answer == "Y":
            print("Clean terminals and try starting again.")
        elif answer == "N":
            print("Replace cables and try again.")
        else:
            print("Please input y/n answer only.")
    elif answer == "N":
        answer = raw_input("Does the car make a clicking noise? ")
        if answer == "Y":
            print("Replace the battery.")
        elif answer == "N":
            answer = raw_input("Does the car crank up but fail to start? ")
            if answer == "Y":
                print("Check spark plug connections.")
            elif answer == "N":
                answer = raw_input("Does the engine start and then die? ")
                if answer == "Y":
                    answer = raw_input("Does your car have fuel injection? ")
                    if answer == "Y":
                        print("Get it in for service.")
                    elif answer == "N":
                        print("Check to ensure the choke is opening and closing.")
                    else:
                        print("Please input y/n answer only.")
                elif answer == "N":
                    print("Engine is not getting enough fuel. Clean fuel pump.")

# Display error message when entering answers that are neither y or n
                else:
                    print("Please input y/n answer only.")
            else:
                print("Please input y/n answer only.")
        else:
            print("Please input y/n answer only.")
    else:
        print("Please input y/n answer only.")

    return

diagnose_car()
{'fraction_non_alphanumeric': 0.1003155996393147, 'fraction_numerical': 0.0063119927862939585, 'mean_word_length': 1.8207247298156388, 'pattern_counts': {'":': 24, '<': 9, '<?xml version=': 0, '>': 9, '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}}
{'dir': 'git-commits-cleaned', 'id': '1816204', 'n_tokens_mistral': 1189, 'n_tokens_neox': 1086, 'n_words': 464}