Write code to print the name of each city

Assignment Help Python Programming
Reference no: EM132586574

Question 1 - Required
Code this question in a separate file. When your solution works, paste it into the "starter file" in the location for question 1.
The code provided assigns data to the following dictionary:

1. Create a DataFrame using ['name', 'sales', 'region'] as column headings:
2. Display the records in the DataFrame which have a value of sales that is more than 40000. Print the resulting DataFrame.
3. Display the records in the DataFrame arranged in alphabetical order by region, with sales in each region from highest to lowest. Print the resulting DataFrame.

Question 2 -Required.
You may wish to develop your solution in a separate file. When your solution works, paste it into the "starter file" in the location for Question 2.
This question uses the data file courses.csv which contains information about fall and spring enrollments for several courses.
1. Create a stacked bar chart showing the number of students enrolled in each course during both fall and spring semesters.
2. Include a legend, title, cyan and green colors, axis labels, and ticks as shown. The width of each bar is 0.3.
3. The largest y-tick value is based on calculating the maximum values for fall and spring enrollments, and spacing them in intervals of 100.
(Please do not use a Pandas DataFrame for this question, but rather, implement your solution using techniques for reading and interacting with CSV files.)

Question 3 -Optional. Answer any four of the six optional questions.
You may wish to develop your solution in a separate file. When your solution works, paste it into the "starter file" in the location for Question 3.
This question uses the data file courses.csv which contains information about fall and spring enrollments for several courses. The first line of the file is a header row. the file is here: courses.csv
Write code to open the file and calculate the total number of students enrolled in any course containing the word "Java" in its name during the Fall Semester. Use whatever file reading techniques you wish to solve the problem.

Question 4-Optional. Answer any four of the six optional questions.
You may wish to develop your solution in a separate file. When your solution works, paste it into the "starter file" in the location for Question 4.
Write a function compare_letters(word1, word2) that returns a string describing whether two words share the same letters in corresponding positions.
The function returns a new string where each character is a + if the corresponding characters in word1 and word2 are the same, and - if they are different. If the strings are of different lengths, the resulting string should contain a ? for each position of the longer string.
Examples:
Your code should work for the three different cases shown in the code in the starter file for question 4. Hint: Get the function to work for two words which have the same length first. Calculate the difference in lengths from both words and append that many "'?"'s to the result.

Question 5-Optional. Answer any four of the six optional questions.

You may wish to develop your solution in a separate file. When your solution works, paste it into the "starter file" in the location for Question 5.

1. Rewrite this code to use a list comprehension.
2. Write a loop to print the index of each item in the list, followed by the original price and price with sales tax.

Question 6-Optional. Answer any four of the six optional questions.

You may wish to develop your solution in a separate file. When your solution works, paste it into the "starter file" in the location for Question 6.
Consider the list of gadgets:
1. Write Python code to display each item followed by its price.
2. Calculate and print the average cost of all items. Hint: You may use the statistics module to compute the average or write code to do it yourself, but that's longer!

Question 7-Optional. Answer any four of the six optional questions.

You may wish to develop your solution in a separate file. When your solution works, paste it into the "starter file" in the location for Question 7.
Consider the dictionary containing hotel prices in various cities:

1. Write code to print the name of each city followed its most expensive hotel price.
2. Write code to compute and print the city and most expensive hotel price from those included in the dictionary.

Question 8-Optional. Answer any four of the six optional questions.

You may wish to develop your solution in a separate file. When your solution works, paste it into the "starter file" in the location for question 8.
A short name is defined as the first letter of a person's first name followed by the first five letters of their last name, converted to upper case. If the last name has five or fewer letters, use the entire last name.)
1. Write a function shortname(name) to return a short name given a tuple containing a first name and last name.
2. Write a function print_short( name, short) to display the full name (first and last, separated by a space) formatted in a field of 20 spaces, followed by the word Shortname:and the corresponding short name.
Your code should work with the sample code provided in the starter file.

Attachment:- Assignment Question.rar

Reference no: EM132586574

Questions Cloud

What is the purpose of including the ph indicator phenol : What is the purpose of including the pH indicator phenol red in the medium?
How do plan to audit dunks closing procedures : How do you plan to audit Dunks's closing procedures? What potential errors would you be most interested in?described above could affect your risk assessment.
What is the selective agent in pea media : What is the selective agent in PEA media? How does it work?
Which bacteria develop antibiotic resistance : What are different ways by which bacteria develop antibiotic resistance?
Write code to print the name of each city : Create a DataFrame using ['name', 'sales', 'region'] as column headings - develop your solution in a separate file. When your solution works
Explain how organisms can develop resistance : Explain how organisms can develop resistance to chemical disinfectants?
Case study design-restate your general phenomena : Restate your general phenomena. Research question: Explain the "unique" case (or cases) you intend to research using this approach.
Will liabilities owing to and amounts receivable : Will liabilities owing to and amounts receivable from organisations within the group be eliminated in consolidation process? Why or why not?
Developed a life-threatening mrsa infection : You turn on a television and catch the end of an interview with a young patient who developed a life-threatening MRSA infection

Reviews

Write a Review

Python Programming Questions & Answers

  Design a program that creates an object of the class

Design a program that creates an object of the class and prompts the user to enter the name, type, and age of his pet.

  Project title email spam filterabstractanalyze the emails

project title email spam filterabstractanalyze the emails and predict whether the mail is a spam or not a spam.to work

  Turn the turtle image into a .gif picture

How can you turn the turtle image into a .gif picture when using the built-in turtle for Python? If that's impossible how do you remove the line when you move the turtle around?

  Identify the top three comments made in given survey

Identify the top three comments made in survey years 2015 and 2016. Report the top three most common comments based on their relative frequency.

  Write a function to return the reverse complement of a dna

In the DNA double helix, two strands twist together and "face" each other. The two strands are reverse-complementary, i.e., reading one strand.

  Write a program to solve a simple payroll calculation

Write a program to solve a simple payroll calculation. Find the amount of pay given, hours worked, and hourly rate. Display hourly rate, hours worked, and pay.

  What is some of the functionality that is possible

Need help in understanding a few things about Apple Script. What is some of the functionality that is possible

  Calculate and show the sum and max of those numbers

Ask the user to enter X numbers into a list. Put those numbers into a list, and show the list. Calculate and show the sum, average, min, max of those numbers.

  Develop a Python application that can display Biorhythms

Your main task is to develop a Python application that can display Biorhythms for any person given their date of birth and the target date

  Report the total number of pies you can make

Prompt the user for the # of crust, meat, corn, and potatoes they have. Report the total number of pies you can make, and the leftover ingredients.

  Prompts the user to enter an oligonucleotide sequence

Write a program that prompts the user to enter an oligonucleotide sequence - After displaying the reverse complement, the program should then prompt

  Write a program that reads a file containing two columns

Write a program that reads a file containing two columns of integers. Print the sum of each column. Use a loop to read the data from the file.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd