Mean population of US States with graph
    import random
    import numpy
    from statistics import mode
    import matplotlib.pyplot as plt
    import csv
    import collections
    
    ##dictionary of States and populations
    from numpy import ndarray
    
    #states_info_dic = {
    #    "California": 39538223,
    #    "Texas": 29145505,
    #    "Florida": 21538187,
    #    "New York": 20201249,
    #    "Pennsylvania": 13002700,
     #   "Illinois": 12812508,
     #   "Ohio":	11799448,
     #   "Georgia": 10711908,
     #   "North Carolina": 10439388,
    ##    "Michigan": 10077331,
    #    "New Jersey":8882190,
    #    "Virginia":	8535519,
     #   "Washington":7614893,
     #   "Arizona":	7278717,
    #    "Massachusetts":6949503,
    #    "Tennessee":6833174,
     #   "Indiana":	6732219,
     #   "Missouri":	6137428,
     #   "Maryland":	6045680,
     #   "Wisconsin":5822434
    #}
    
    states_info_dic = {
        "Cal": 39538223,
        "Tex": 29145505,
        "Flo": 21538187,
        "NY": 20201249,
        "Pen": 13002700,
        "Ill": 12812508,
        "Ohio":	11799448,
        "Geo": 10711908,
        "NC": 10439388,
        "Mich": 10077331,
        "NJ":8882190,
        "Vir":	8535519,
        "Was":7614893,
        "Ari":	7278717,
        "Mass":6949503,
        "Ten":6833174,
        "Ind":	6732219,
        "Miss":	6137428,
        "Mary":	6045680,
        "Wis":5822434
    }
    
    
    ##print values of states
    population = list(states_info_dic.values())
    
    print(population)
    
    ##round population
    round_up_list =[]
    for num in population:
        round_up_int=num/1000000
        round_up_list.append(round(round_up_int))
    
    #Mean, median and mode of list
    mean1=numpy.mean(population)
    median1=numpy.median(population)
    mode1=mode(round_up_list)
    
    print(f"The mean of the population is {mean1}")
    print(f"The median of the population is {median1}")
    print(f"The mode of the population is {mode1}")
    
    
    
    
    
    
    print(round_up_list)
    
    ##Grpah population information
    # x-coordinates of left sides of bars
    left = states_info_dic.keys()
    
    # heights of bars
    height = states_info_dic.values()
    
    
    # plotting a bar chart
    plt.bar(left, height, width=0.8, color=['green'])
    
    # naming the x-axis
    plt.xlabel('States')
    # naming the y-axis
    plt.ylabel('Populations')
    # plot title
    plt.title('U.S States populations')
    
    # function to show the plot
    plt.show()