5. 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
# Online Python compiler (interpreter) to run Python online.
# Write Python 3 code in this online editor and run it.
s1 = input()
s2 = input()
s3 = input()
if s1[1] == s2[1] and s[2] == s[3]:
print('Same')
else:
print('Not the Same')
Comments
Leave a comment