given polynomial write a program that prints polynomial in cix^pi + ci-1x^pi-1 c1x + c0 format
Enter your name: Hunter Chase Sanford
Enter your course: I.T
Enter your year and section: 2-A
Enter the academic year: 2021-2022
Enter first number: 6
Enter second number: 2
Hello, Hunter Chase Sanford! You are currently enrolled in I.T 2-A, A.Y. 2021-2022.
The sum is: 8
The difference is: 4
The product is: 12
The quotient is: 3
You've learned in the past lessons on how to use square root functions, right? Then let's take your knowledge to the test. Print out the square root of a given integer with only two decimal places.
Ready, solve, and go!
Input
A line containing an integer.
4Output
A line containing a decimal with two decimal places.
2.00NOTE: There are several test cases resulting in different values.
Multiplying two numbers is a piece of cake, but how about multiplying three of them, either being a negative of positive number? With programming and proper code, these tasks are easy to handle.
You're a programmer, right? Then code this one for me!
Input
A line containing three numbers (positive or negative, may have decimal places) separated by a space.
1.6·-2·-1Output
A line containing a decimal/float with one decimal place.
NOTE: There are several test cases with different input which results in different output
def invert_dict(d):
inverse = dict()
for key in d:
val = d[key]
if val not in inverse:
inverse[val] = [key]
else:
inverse[val].append(key)
return inverse
Modify this function so that it can invert your dictionary. In particular, the function will need to turn each of the list items into separate keys in the inverted dictionary.
Run your modified invert_dict function on your dictionary. Print the original dictionary and the inverted one.
Include your Python program and the output in your Learning Journal submission.
Describe what is useful about your dictionary. Then describe whether the inverted dictionary is useful or meaningful, and why.
Write a loop over the strings in list test_miss and call missing_letters with each string. Print a line for each string listing the missing letters. For example, for the string "aaa", the output should be the following.
aaa is missing letters bcdefghijklmnopqrstuvwxyz
If the string has all the letters in alphabet, the output should say it uses all the letters. For example, the output for the string alphabet itself would be the following.
abcdefghijklmnopqrstuvwxyz uses all the letters
Print a line like one of the above for each of the strings in test_miss.
Submit your Python program. It should include the following.
The provided code for alphabet, test_dups, test_miss, and histogram.
Your implementation of the has_duplicates function.
A loop that outputs duplicate information for each string in test_dups.
Your implementation of the missing_letters function.
A loop that outputs missing letters for each string in test_miss.
Write a function called missing_letters that takes a string parameter and returns a new string with all the letters of the alphabet that are not in the argument string. The letters in the returned string should be in alphabetical order.
Your implementation should use a histogram from the histogram function. It should also use the global variable alphabet. It should use this global variable directly, not through an argument or a local copy. It should loop over the letters in alphabet to determine which are missing from the input parameter.
The function missing_letters should combine the list of missing letters into a string and return that string.
We Filipinos are quite known for the habit of leaving at least one of the many pieces of food on the plate as it can't be equally divided among all at most times. Just like when 3 people decide to eat a pizza of 10 slices, there will often be at least one slice left on the box. To accurately show just how many pieces of things are left when divided by a certain number, we code it using modulo.
Care to do it for me?
Input
A line containing two integers separated by a space.
10·3
Output
A single line containing an integer.
1
NOTE: There are several test cases with different input and output that contain integers only.