Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

how to call and open a file in python ?

+1 vote
asked Sep 30, 2022 by jerome (130 points)

3 Answers

0 votes
answered Oct 2, 2022 by Peter Minarik (86,580 points)
0 votes
answered Oct 4, 2022 by dsa learner (260 points)
use

f =open("File path", "r") - if your file is in the same folder as this code then write 'filename.extension

else write full path

print(f.read)
+1 vote
answered Oct 4, 2022 by codenxn (1,350 points)

with open("File path") as file:

    print(file.read())

Hope that helps!

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...