Even though i write this code i am not able to get proper output.please help me to do. This
8. Square Root
by CodeChum Admin
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
7. Enumeration
by CodeChum Admin
Have you ever answered a test question that tells you to enumerate a series of things, but the answer must be in a sentence? Quite tiring to write those things separated by commas and a single space, isn't it?
Then let's try coding it instead!
Input
Five lines containing a string on each.
C
C#
Java
Python
Javascript
Output
A single line containing all the strings separated by a comma and a space.
C, C#, Java, Python, Javascript
6. Three Lines Apart
by CodeChum Admin
Do you like reading books? If you do, then you must have encountered texts that have quite a wide space with dots in between them, just like pausing or thinking before proceeding the narration. Let's try doing that here in Python, shall we?
Input
Two lines containing a string on each.
some string
another string
Output
The first line contains the first inputted string.
The next three lines contains a dot symbol on each.
The last line contains the second inputted string.
some string
.
.
.
another string
by CodeChum Admin
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.
3.24. Leftovers
by CodeChum Admin
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
3. The More, The Lengthier
by CodeChum Admin
I think it's already a given that two sentences combined will always be longer than a single sentence alone, but to prove just how long two sentences can be, why don't we let our program show the combined length of the two randomly inputted strings?
Let's get it on!
Input
Two lines containing a string on each.
Python is fun
I love CodeChum
Output
A single line containing an integer.
28
2. Quotation Duo
by CodeChum Admin
Quotation marks are usually paired with a similar type, like a double quote (") paired with another double quote ("), and the same goes for single quotes ('). However, I'd like to try complicating things by putting together a pair of a double quote(") and a single quote(') in one statement!
Can you do this simple challenge?
Output
A line containing a string.
"'
1. Triple Slash
by CodeChum Admin
Samurais are so awesome! I'd like to imitate their amazing sword skills some time but I just don't have the courage to harm myself, so I'd just like to print out three forward slashes (\) to digitally imitate the samurai's triple slash skill. Haha!
Sounds easy, right? Then code it now!
Output
Three lines with a single backslash symbol.
\
\
\
my output:
12x^4 + 9x^3 - 5x^2 - 1x - 1
excepted output:
12x^4 + 9x^3 - 5x^2 - x - 1
For term Cix^Pi, if the coefficient of the term Ci is 1, simply print x^Pi instead of 1x^Pi.