+ 3
Explain this line of code..
#input print(open(__file__).read()) #output is same how? #print(open(__file__).read())
2 Answers
+ 9
__file__ is the name Python gives to the current .py script being executed. What you are doing is essentially opening the file that is being run, reading it and printing it.
Here's a silly code I wrote to have a bit of fun with that đ
https://code.sololearn.com/cyVMX5BsatD7/?ref=app
0
David Ashton can you explain in simple language please,i found it complicated