Consider the following Python statement:
F = open('CONTENT.TXT')
Which of the following is an invalid statement in Python?
F.seek(1, 0)
F.seek(0, 1)
F.seek(0, -1)
F.seek(0, 2)
Python's seek() method modifies a file's current position. It accepts two arguments: 1. offset: the byte position to move the file pointer. 2. whence: the reference point for offset. The valid values for whence are: 0 for the beginning of the file, 1 for the current file position, and 2 for the end of the file. An offset value of -1 for whence is invalid, thus F.seek(0, -1) is an incorrect usage.
myStr[:4] extracts the first 4 characters, which are "MISS".myStr[-5:] extracts the last 5 characters, which are "SIPPI"."#" in between, resulting in "MISS#SIPPI".
event = "G20 Presidency@2023"
L = event.split(' ')
print(L[::-2])