Answer to Question #249656 in Python for justhin

Question #249656

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





1
Expert's answer
2021-10-11T00:05:11-0400
s1 = input("Input the first string: ")
s2 = input("Input the second string: ")
ans = s1 + ' ' + s2
print("Combined string:")
print(ans)
print("Combined string length:", len(ans))

Example:
Input the first string: Python·is·fun
Input the second string: I·love·CodeChum
Combined string:
Python·is·fun I·love·CodeChum
Combined string length: 29

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS