×
Reviews 4.9/5 Order Now

Create a Program to Implement Ham Radio Countries in Python Assignment Solution.

July 15, 2024
Sophie Bennett
Sophie Bennett
🇬🇧 United Kingdom
Python
Sophie Bennett is a seasoned Python Assignment Expert with a wealth of 14 years of experience. She holds a Master's degree from a leading institution, bringing a comprehensive skill set to every Python challenge.
Key Topics
  • Instructions
  • Requirements and Specifications
Tip of the day
Always start SQL assignments by understanding the schema and relationships between tables. Use proper indentation and aliases for clarity, and test queries incrementally to catch errors early.
News
Owl Scientific Computing 1.2: Updated on December 24, 2024, Owl is a numerical programming library for the OCaml language, offering advanced features for scientific computing.

Instructions

Objective

Write a program to implement ham radio countries in Python.

Requirements and Specifications

Homework 2 – Ham Radio Countries

You are given two lists of country names. Each list is contained in a module that is separate from the module( program) you will write.

One list contains the countries you have worked (talked to); the other contains countries you have confirmed. The program will find and print all the countries that are in the worked list but not in the confirmed list. The number of countries not yet confirmed is 27.

Requirements:

  1. Import the country lists from the other two modules
  2. Do not allow any unhandled errors.
  3. Include a comment header and comments throughout the code
  4. Use the ‘standard’ method of naming variables
  5. Sort the results list in ascending order
  6. Format the output so it is in two columns
  7. Write the code neatly
  8. Display the results neatly

Source Code

from countries_confirmed_start import * from countries_worked_start import * # Fore ach country we worked with, filter and select # only those that did not confirm unconfirmed_countries = [] for country in worked_list: if country not in confirmed_list: unconfirmed_countries.append(country) # Sort the results in ascending order for i in range(len(unconfirmed_countries) - 1): for j in range(i + 1, len(unconfirmed_countries)): if unconfirmed_countries[i] > unconfirmed_countries[j]: country = unconfirmed_countries[i] unconfirmed_countries[i] = unconfirmed_countries[j] unconfirmed_countries[j] = country # Print in 2 columns right justified next_column = 0 for country in unconfirmed_countries: print(str(country[0]).rjust(30), end="") next_column += 1 if next_column % 2 == 0: print() # Print in 2 columns left justified print("\n") next_column = 0 for country in unconfirmed_countries: print(str(country[0]).ljust(30), end="") next_column += 1 if next_column % 2 == 0: print()

Similar Samples

Explore our Python assignment sample to see firsthand how our experts tackle complex programming challenges. Our samples demonstrate clear problem-solving approaches, adherence to best coding practices, and proficiency in Python libraries. Whether it's data analysis, web development, or algorithmic tasks, our samples showcase the quality and expertise we bring to every Python assignment.