In Python. Assume that given, middle and family are three variables of type Stri
ID: 3875742 • Letter: I
Question
In Python. Assume that given, middle and family are three variables of type String that have been assigned values. Write an expression whose value is a String consisting of the first character of given followed by a period followed by the first character of middle followed by a period followed by the first character of family followed by a period: in other words, the initials of the name. So if the values of these three variables were "John" "Fitzgerald" "Kennedy", then the expression's value would be "J.F.K.".
Explanation / Answer
given = "John"
middle = "Fitzgerald"
family = "Kennedy"
initial = given[0] + '.'+middle[0] + '.' + family[0] + "."
print initial
Output:
J.F.K.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.