Ask Question
2 November, 08:06

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.

+3
Answers (1)
  1. 2 November, 08:29
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers