Answer to Question #315175 in Python for sabiha

Question #315175

first letters



you are given three strings are inputs. write a program to print the first character of each string.



input



the first,second and third lines of input are strings.



explanation



consider the given strings to be apple, banana and carrot.we need to consider the first character in each of these strings we get the character a from the string apple. we get the character b from the string banana. we get the character c from the string carrot. so the final output should be abc



sample input 1



apple


banana


carrot



sample output 1


abc



sample input 1



very


important


person



sample output 2


vip



1
Expert's answer
2022-03-21T16:10:29-0400
def first_three_character(strings):
    strings = []
    first_character = []
    for i in range(1):
        strings = [input("Enter first string: "), input("Enter second string: "),input("Enter third string: ")]
        for string in strings:
            first_character.append(string[i][0])
    return first_character[0]+first_character[1]+first_character[2]

first_three_character(strings)

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