Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

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


Armstrong numbers between two intervals



Write a program to print all the Armstrong numbers in the given range



A to B(including A and B). An N-digit number is an Armstrong number if the number equals the sum of the Nth power of its digits.



Input



The first line has an integer



A. The second line has an integer B.



Output



Print all Armstrong numbers separated by a space.

If there are no Armstrong numbers in the given range, print



-1.



Explanation



For



A = 150 and B = 200



For example, if we take number 153, the sum of the cube of digits



1, 5, 3 is



13 + 53 + 33 = 153.



So, the output should be



153.



Sample Input 1

150

200

Sample Output 1

153

Sample Input 2

1

3

Sample Output 2

1 2 3



please provide correct output in sample output 2



please provide correct output in sample output 3

Sample output 3 is
-1

the above output 3
A=10
And
B=15

Output is
-1
Please provide correct output of sample output 3
Write a program that asks the user for a magic number. While the user cannot guess the magic number which is 7, ask the user again for another guess. If the guess is incorrect, print "That is not the magic number" or else if the guess is correct, print "You have guessed it".

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.


4

Output

A line containing a decimal with two decimal places.


2.00


NOTE: 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·-1

Output


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.



LATEST TUTORIALS
APPROVED BY CLIENTS