Which function in Python is used to read file contents as a string?
- file()
- load()
- open()
- read()
The read()
function in Python is used to read the content of a file as a string. It reads the entire contents of the file into a string variable.
Loading...
Related Quiz
- Which Python library is specifically designed for creating static, interactive, and real-time graphs and plots?
- If you want to make a variable defined in an outer function accessible to an inner function, you use the _______ keyword.
- How would you run a Python script from the command line and pass arguments to it?
- How would you optimize the performance of a deep learning model in TensorFlow or PyTorch during the inference stage?
- How would you implement a custom loss function in a TensorFlow or PyTorch model?