-6

I was looking for how to get my code running. Then I found something in Stack Overflow that works, but I don't understand it. I'm having a hard time understanding the 2nd line.

file = input("File name: ").casefold().strip()
fileType = file[file.index("."):]  # I don't understand this line
fileType = fileType[1:]
jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
  • `file.index(".")` returns the index of `"."` inside your string. Then you are slicing this string from the before mentioned index until the end of your string. – binaryescape Aug 05 '23 at 15:11
  • So split the line into its components, see what each one does, *then* you will know what the whole does. – SiHa Aug 05 '23 at 15:18

0 Answers0