1

Where to get the File name from?

file= open("C:\Users\Dell\Desktop\ll\file3.txt", "r")

python shows me that there is a syntax error,is it the file name?

Cory Kramer
  • 114,268
  • 16
  • 167
  • 218

1 Answers1

3

You need to use a raw string literal

r"C:\Users\Dell\Desktop\ll\file3.txt"

or escape your backslashes

"C:\\Users\\Dell\\Desktop\\ll\\file3.txt"
Cory Kramer
  • 114,268
  • 16
  • 167
  • 218