Ask Question

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.

+2
Answers (1)
  1. 7 March, 10:17
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers