Ask Question
12 September, 14:47

Write a program that initializes a string variable and prints the first three characters, followed by three periods, and then the last three characters. For example, if the string is initialized to "Mississippi", then print Mis ... ppi.

+1
Answers (1)
  1. 12 September, 18:41
    0
    firstly we have to initialize the variable, means to give variable a value and then print the statement

    string = "fahadisahadam"

    print (string[:3]+" ... "+string[-3:])

    string is a data type that contains two or more characters.

    means the string is fahadisahadam so the print will print first three characters. follow by three periods ( ...) and then last three characters.

    The output will be:

    fah ... dam
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write a program that initializes a string variable and prints the first three characters, followed by three periods, and then the last ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers