Answer to Question #286236 in Python for John

Question #286236

String[1] Check


by CodeChum Admin



As long as you haven't forgotten about indexing, you'll be just fine.





Instructions:



Input three strings in different lines.


Print out "Same" if all of their 2nd characters are the same, else print out "Not the Same".


Input



Three lines containing a string on each.



Cry


Priest


Fry


Output



A line containing a string.



Same


1
Expert's answer
2022-01-10T11:19:40-0500
str1=input('Enter the first string:')
str2=input('Enter the second string:')
str3=input('Enter the third string:')
if str1[1]==str2[1]==str3[1]:
    print("Same")
else:
    print("Not the Same")

Enter the first string:Cry
Enter the second string:Priest
Enter the third string:Fry
Same

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