Answer to Question #257871 in Python for pau

Question #257871

 What's in the Middle?

by CodeChum Admin

You already know how to access the middle value of a certain string using index positions, right? Then let's put your learnings to practice.

Make a program that shall input a long string that contains an odd number of individual strings separated by comma. Afterwards, input the string that's located in the middle index position.

Let's do this.


Input

A line containing a string separated by a comma.

Python,is,fun

Output

A line containing a string.

is
1
Expert's answer
2021-11-01T01:59:00-0400
lst = input().split(',')
print(lst[len(lst) // 2])

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