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

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
Digit 9


You are given


N as input. Write a program to print the pattern of 2*N - 1 rows using an asterisk(*) as shown below.Note: There is a space after each asterisk * character.Input

The first line of input is an integer


N.Explanation

In the given example,




sample input is 4


the output should be like this...

* * * *
*     *
*     *
* * * *
      *
      *
* * * *

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

4. Decimal x Decimal

by CodeChum Admin

Now that we're done with integers, we're moving on to decimals!


Instructions:

  1. Input three decimal numbers with only two decimal places in one line separated by spaces, store them inside variables.
  2. Multiply the 1st and 2nd decimal numbers, store the product.
  3. Divide the product of the 1st and 2nd decimal numbers with the 3rd decimal number, then print out the quotient with only two decimal places.

Instructions

  1. Input three decimal numbers with only two decimal places in one line separated by spaces, store them inside variables.
  2. Multiply the 1st and 2nd decimal numbers, store the product.
  3. Divide the product of the 1st and 2nd decimal numbers with the 3rd decimal number, then print out the quotient with only two decimal places.

Input

A line containing three decimal numbers with two decimal places separated by a space.


1.53·2.25·1.23

Output

A line containing the result with two decimal places.


2.80

6. Integer Pairing

by CodeChum Admin

Now this one's a tad bit tricky, but you can definitely do it!


Instructions:

  1. Input five integers in one line, with each integer separated by a space.
  2. Add the 1st and 2nd integers together, store the sum inside a variable.
  3. Add the 3rd and 4th integers together, store the sum inside a variable.
  4. Multiply the two sums with each other and raise the product to the power of the 5th integer
  5. Print out the result.

Instructions

  1. Input five integers in one line, with each integer separated by a space.
  2. Add the 1st and 2nd integers together, store the sum inside a variable.
  3. Add the 3rd and 4th integers together, store the sum inside a variable.
  4. Multiply the two sums with each other and raise the product to the power of the 5th integer
  5. Print out the result.

Input

A line containing five integers separated by a space.


1·2·3·4·5

Output

A line containing an integer.


4084101

Write a program that asks the user for an integer greater than 0 and then use a for-loop to


calculate the factorial of that positive integer.


Modify your program so that the output looks like the following:


Example: 5! = 5 x 4 x 3 x 2 x 1 = 120


Create a for-loop that loops from 0 up to and including 20. On each iteration, output a '*' (an asterisk) if the value of the counter variable is divisible by 2, a '@' if divisible by 3, and a '$' if divisible by 4. In all other cases, output a '!'. Each symbol should be printed on a different line.


Write a program that asks the user for an integer greater than 0 and then use a for-loop to


calculate the factorial of that positive integer.


Modify your program so that the output looks like the following:


Example: 5! = 5 x 4 x 3 x 2 x 1 = 120


Create a for-loop that loops from 0 up to and including 20. On each iteration, output a '*' (an asterisk) if the value of the counter variable is divisible by 2, a '@' if divisible by 3, and a '$' if divisible by 4. In all other cases, output a '!'. Each symbol should be printed on a different line.


Create a library management system with full source code.

LATEST TUTORIALS
APPROVED BY CLIENTS