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

""" Assignment 1, Exercise 2, INF1340, Fall, 2015. Name that shape.

This module contains one function name_that_shape(). It prompts the user
to input the number of sides in a shape and outputs the name of the shape.

"""

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


def name_that_shape():
    """
    For a given number of sides in a regular polygon, returns the shape name

    Inputs:

    Expected Outputs:

    Errors:

    >>>3
    Triangle
    >>>12
    Error

    """

    dict = {'3': 'Triangle', '4': 'Quadrilateral', '5': 'Pentagon', '6': 'Hexagon',
            '7': 'Heptagons', '8': 'Octagon', '9': 'Nonagon', '10': 'Decagon'}

    number_of_sides = raw_input("Please enter the number of sides (only valid from 3 to 10):")

    if number_of_sides in dict.keys():
        print(dict[number_of_sides])
    else:
        print("Error")

<commit_msg>Comments added and test cases given<commit_after>#!/usr/bin/env python

""" Assignment 1, Exercise 2, INF1340, Fall, 2015. Name that shape.

This module contains one function name_that_shape(). It prompts the user
to input the number of sides in a shape and outputs the name of the shape.

"""

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


def name_that_shape():
    """
    For a given number of sides in a regular polygon, returns the shape name

    Inputs:3,4,5

    Expected Outputs:Triangle,Quadrilateral,Pentagon

    Errors:None

    >>>3
    Triangle
    >>>12
    Error

    """

    # This is the dictionary containing key value pairs
    dict = {'3': 'Triangle', '4': 'Quadrilateral', '5': 'Pentagon', '6': 'Hexagon',
            '7': 'Heptagons', '8': 'Octagon', '9': 'Nonagon', '10': 'Decagon'}

    # This code asks for user input of number of sides
    number_of_sides = raw_input("Please enter the number of sides (only valid from 3 to 10):")

    # This code assess if the entered number is a key in the dictionary and if so prints the value
    if number_of_sides in dict.keys():
        print(dict[number_of_sides])
    else:
        print("Error")


{'fraction_non_alphanumeric': 0.12180656934306569, 'fraction_numerical': 0.027828467153284672, 'mean_word_length': 3.283203125, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, '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': '1243756', 'n_tokens_mistral': 752, 'n_tokens_neox': 682, 'n_words': 262}