Python Answers

Questions answered by Experts: 5 288

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

Create a library management system wherein any library member should be able to search books by their title, author, subject category as well by the publication date.


7. Negative Decimal Tally

by CodeChum Admin

We've been giving positive numbers too much attention lately, it's time to let negative numbers take the spotlight this time!


Instructions:

  1. Input four float numbers; they could be positive or negative.
  2. Only add all inputted negative numbers, and print its sum, up to 2 decimal place.
  3. Hint: The previous/latest topic is about if-else-elseif statements, but do we need one here?

Instructions

  1. Input four decimal numbers, they could be positive or negative.
  2. Add all the negative numbers, and print the sum, up to 2 decimal places.

Input

A line containing four decimals/floats separated by a space.


-30.22·10.5·-2.2·-1.8

Output

A line containing a negative decimal/floats with two decimal places.


-34.22

8. Sort It Yourself

by CodeChum Admin

A descending order means values arranged from largest to smallest. But in your case, you're going to have to sort these integers in ascending order, which means from smallest to largest.


Instructions:

  1. Input three integers.
  2. Print the integers in ascending order using your knowledge on conditional statements.

Instructions

  1. Input three integers.
  2. Print the integers in ascending order.

Input

A line containing three integers separated by a space.


6·1·3

Output

A line containing three integers separated by a space.


1·3·6

7. Negative Decimal Tally

by CodeChum Admin

We've been giving positive numbers too much attention lately, it's time to let negative numbers take the spotlight this time!


Instructions:

  1. Input four float numbers; they could be positive or negative.
  2. Only add all inputted negative numbers, and print its sum, up to 2 decimal place.
  3. Hint: The previous/latest topic is about if-else-elseif statements, but do we need one here?

Instructions

  1. Input four decimal numbers, they could be positive or negative.
  2. Add all the negative numbers, and print the sum, up to 2 decimal places.

Input

A line containing four decimals/floats separated by a space.


-30.22·10.5·-2.2·-1.8

Output

A line containing a negative decimal/floats with two decimal places.


-34.22

6. Largest Digit

by CodeChum Admin

This one is a bit tricky. You're going to have to isolate each digit of the integer to determine which one is the largest, so good luck!


Instructions:

  1. Input a 3-digit integer.
  2. Print the largest digit in the integer.
  3. Tip #1: Use % 10 to get the rightmost digit. For example, if you do 412 % 10, then the result would be the rightmost digit, which is 2.
  4. Tip #2: On the other hand, use / 10 to remove the rightmost digit. For example, if you do 412 / 10, then the result would be 41.
  5. Tip #3: You'd have to repeat Tip #1 and Tip #2 three times for this problem because the input is a 3-digit integer.

Instructions

  1. Input one 3-digit integer.
  2. Print the largest digit in the integer. (Hint: use % 10 to get the rightmost digit and / 10 to remove it)

Input

A line containing a three-digit integer.


173

Output

A line containing a single-digit integer


7

5. Operation: Operation

by CodeChum Admin

You have been cordially invited to partake in Operation: Operation. Your mission, should you choose to accept it, is to take the two numbers and the operator given then perform the operation successfully.


Instructions:

  1. Input one number (integer or decimal), an operator (+, -, *, /), and another number (integer or decimal).
  2. Print the result of the operation between the two numbers, up to 2 decimal places.

Instructions

  1. Input one number (integer or decimal), an operator (+, -, *, /), and another number.
  2. Print the result of the operation between the two numbers, up to 2 decimal places.

Input

The first line contains the first number.

The second line contains the operator.

The third line contains the second number.

5
+
0.70

Output

A line containing a decimal/float containing two decimal places.


5.70

4. Length Comparison Redux

by CodeChum Admin

The first time around we did this was a bit simple. Let's kick it up a notch don't you think?


Instructions:

  1. Input two strings in different lines.
  2. If the 1st string is longer than the 2nd string, print "First". If the 2nd string is longer than the 1st string, print "Second". But if both strings have the same length, print "Equal".

Instructions

  1. Input two strings in different lines.
  2. If the 1st string is longer than the 2nd string, print "First". If the 2nd string is longer than the 1st string, print "Second". But if both strings have the same length, print "Equal".

Input

Two lines containing a string on each.


VeryLongText
ShortText

Output

A line containing a string.


First

3. Are Strings Created Equally?

by CodeChum Admin

Do you believe in doppelgangers? Well they are very much possible with strings! Check if the two given strings are the same or not.


Instructions:

  1. Input two strings in different lines (one each line).
  2. Print out the strings in one line, separate them with a \.
  3. Check whether the two strings are equal, print out "Equal" if they are.

Instructions

  1. Input two strings in different lines (one each line).
  2. Print out the strings in one line, separate them with a \.
  3. Check whether the two strings are equal, print out "Equal" if they are.

Input

Two lines containing a string on each.


hello
hello

Output

The first line contains the two inputted strings separated by a \.

The second line contains a string result.

hello\hello
Equal

2. Two is Greater Than One

by CodeChum Admin

They say that the one in first place is always greater than the one in the second and third place. Are they always right?


Instructions:

  1. Input three integers in different lines (one each line).
  2. Print out the integers in one line.
  3. If the 1st integer is greater than or equal to both the 2nd integer and the 3rd integer, print "Yes".

Instructions

  1. Input three integers in different lines (one each line).
  2. Print out the integers in one line.
  3. If the 1st integer is greater than or equal to both the 2nd integer and the 3rd integer, print "Yes".

Input

Three lines containing an integer on each.


3
2
1

Output

The first line contains all the three inputted integers.

The second line contains a string which is the result.

3·2·1
Yes

Replacing Characters of Sentence


You are given a string


S. Write a program to replace each letter of the string with the next letter that comes in the English alphabet.


Note: Ensure that while replacing the letters, uppercase should be replaced with uppercase letters, and lowercase should be replaced with lowercase letters.


Input


The first line of input is a string.


Explanation


In the given example,


Hello World.


If we replace each letter with the letter that comes next in the English alphabet,


H becomes I, e becomes f and so on ... So, the output should be Ifmmp Xpsme.


Sample Input 1

Hello World

Sample Output 1

Ifmmp Xpsme

Sample Input 2

Something is better than Nothing

Sample Output 2

Tpnfuijoh jt cfuufs uibo Opuijoh


LATEST TUTORIALS
APPROVED BY CLIENTS