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.

Respuesta :

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