Assignment: Final Course Assignment

Assignment: Final Course Assignment >> Python Basics

Below are a set of scores that students have received in the past semester. Write code to determine how many are 90 or above and assign that result to the value a_scores.

 
 
 

ActiveCode (asign_c01_01)

Expand DifferencesExpand Differences

You passed: 100.0% of the tests

Score: 1.0 / 1

 

Write code that uses the string stored in org and creates an acronym which is assigned to the variable acro. Only the first letter of each word should be used, each letter in the acronym should be a capital letter, and there should be nothing to separate the letters of the acronym. Words that should not be included in the acronym are stored in the list stopwords. For example, if org was assigned the string “hello to world” then the resulting acronym should be “HW”.

 
 
 
 

ActiveCode (asign_c01_02)

Expand Differences

You passed: 100.0% of the tests

Score: 1.0 / 1

 

Write code that uses the string stored in sent and creates an acronym which is assigned to the variable acro. The first two letters of each word should be used, each letter in the acronym should be a capital letter, and each element of the acronym should be separated by a “. ” (dot and space). Words that should not be included in the acronym are stored in the list stopwords. For example, if sent was assigned the string “height and ewok wonder” then the resulting acronym should be “HE. EW. WO”.

 
 
 
 

ActiveCode (asign_c01_03)

Expand DifferencesExpand Differences

You passed: 100.0% of the tests

Score: 1.0 / 1

 

A palindrome is a phrase that, if reversed, would read the exact same. Write code that checks if p_phrase is a palindrome by reversing it and then checking if the reversed version is equal to the original. Assign the reversed version of p_phrase to the variable r_phrase so that we can check your work.

 
 
p_phrase = "was it a car or a cat I saw"
r_phrase = p_phrase[::-1]
 

ActiveCode (asign_c01_04)

Expand DifferencesExpand DifferencesExpand Differences

You passed: 100.0% of the tests

Score: 1.0 / 1

 

Provided is a list of data about a store’s inventory where each item in the list represents the name of an item, how much is in stock, and how much it costs. Print out each item in the list with the same formatting, using the .format method (not string concatenation). For example, the first print statment should read The store has 12 shoes, each for 29.99 USD.

 
 
 
Output:
 
The store has 12 shoes, each for 29.99 USD.
The store has 20 shirts, each for 9.99 USD.
The store has 25 sweatpants, each for 15.00 USD.
The store has 13 scarves, each for 7.75 USD.
The store has 12 shoes, each for 29.99 USD.
The store has 20 shirts, each for 9.99 USD.
The store has 25 sweatpants, each for 15.00 USD.
The store has 13 scarves, each for 7.75 USD.
 
 

ActiveCode (asign_c01_05)

Expand DifferencesExpand DifferencesExpand Differences

You passed: 100.0% of the tests