1. Please write the following code in Python 3.
2. Please also show all outputs.
Create a dictionary named letter_counts that contains each letter and the number of times it occurs in string1. Challenge: Letters should not be counted separately as upper-case and lower-case. Intead, all of them should be counted as lower-case.
string1 = "There is a tide in the affairs of men, Which taken at the flood, leads on to fortune. Omitted, all the voyage of their life is bound in shallows and in miseries. On such a full sea are we now afloat. And we must take the current when it serves, or lose our ventures."
letter_counts = dict()
string1 = "There is a tide in the affairs of men, Which taken at the flood, leads on to fortune. Omitted, all the voyage of their life is bound in shallows and in miseries. On such a full sea are we now afloat. And we must take the current when it serves, or lose our ventures."
for x in string1.lower():
if not letter_counts.get(x):
letter_counts[x] = 1
else:
letter_counts[x] += 1
print(letter_counts)

{'t': 19, 'h': 11, 'e': 29, 'r': 12, ' ': 53, 'i': 14, 's': 15, 'a': 17, 'd': 7, 'n': 15, 'f': 9, 'o': 17, 'm': 4, ',': 4, 'w': 6, 'c': 3, 'k': 2, 'l': 11, 'u': 8, '.': 4, 'v': 3, 'y': 1, 'g': 1, 'b': 1}


1. Please write the following code in Python 3. 2. Please also show all outputs. Create...
1. Pleae write the following code in Python 3. Also, please show all the outputs. . Write a simple Rectangle class. It should do the following: Accepts length and width as parameters when creating a new instance Has a perimeter method that returns the perimeter of the rectangle Has an area method that returns the area of the rectangle Don't worry about coordinates or negative values, etc. Python provides several modules to allow you to easily extend some of the...
1. Please write the following code in Python 3. Please also show all outputs and share your code. Write the following program: The first function, divide that takes in any number and returns that same number divided by 2. The second function called sum should take any number, divide it by 2, and add 6. It should return this new number. You should call the divide function within the sum function. Do not worry about decimals.
1. Please write the following code in Python 3. Also, please write code and not psedo-code. 2. Please also share your code and show all outputs. 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...
1. Please write the following in Python 3 code. Also, write code and not psedo code. Also, show all outputs and share your code. Question: Create one conditional so that if “Friendly” is in w, then “Friendly is here!” should be assigned to the variable wrd. If it’s not, check if “Friend” is in w. If so, the string “Friend is here!” should be assigned to the variable wrd, otherwise “No variation of friend is in here.” should be assigned...
1. Please write the following code in Python 3. Also please show all output(s) and share your code. Below is a for loop that works. Underneath the for loop, rewrite the problem so that it does the same thing, but using a while loop instead of a for loop. Assign the accumulated total in the while loop code to the variable sum2. Once complete, sum2 should equal sum1. sum1 = 0 lst = [65, 78, 21, 33] for x in...
1. Please write the following program in Python 3. Also, please create a UML and write the test program. Please show all outputs. (The Fan class) Design a class named Fan to represent a fan. The class contains: Three constants named SLOW, MEDIUM, and FAST with the values 1, 2, and 3 to denote the fan speed. A private int data field named speed that specifies the speed of the fan. A private bool data field named on that specifies...
Please write code using Python.
Rubric
Assignment Solution Total: 100 pts
Program successfully retrieves and validates user input 15
pts
Morse Code Function Created 10 pts
Function Uses Parameters to get input message 15 pts
Function successfully converts passed message to Morse Code
and returns the Morse Code equivalent of message 45 pts
Program calls Morse Code function and outputs the result of
the function (i.e. the actual Morse Code) 15 pts
Main Function Requirement
Part 2 MUST have a...
Write the code in python, if you cannot answer all the question
please dont anser, thanx very much. Please gimme a screen shot for
code.
Write clear code with comments and follow coding convention. Comments should include your name, student number and subject code on top of your code Question 1 Create a list to store all the subject codes that you are currently doing at UOW Then use for loop to display it in a table as in the...
AND THE USE OF CALCULATORS SPREADSHEETS 2. PLEASE MAKE SURE TO WRITE Sttolal ANSWER EXPLANATIONS THAT ARE SUPPORTED BY YOUR CALCULATIONS WHEN ASKED IN A GINEN QUESTION 3. PLEASE USE EXCEL TO CALCULATE AND SHow WORKINGS. THANKS. 2 Industrial Grinders AWN 4 During the term, we had a case study, Industrial Grinders, which focused on Sunk and Opportunity Costs. 6 Please refer to the table below, which comes from data in the Industrial Grinders case Industrial Grinders 100 Steel Rings...
Write down your analysis of this case on factors like 1. the negotiation process, strategy and tactics PACIFIC OIL COMPANY (A)* "Look, you asked for my advice, and I gave it to you," Frank Kelsey said. "If I were you, I wouldn't make any more concessions! I really don't think you ought to agree to their last demand! But you're the one who has to live with the contract, not me!" Static on the transatlantic telephone connection obscured Jean Fontaine's...