- Joined
- Dec 10, 2018
- Posts
- 86
- Reaction
- 33
- Points
- 103
Ito madali lang to pag alam nyo na mag open ng file. Skip ko na yung ibang explanation kasi nasa attribute na yung meaning mismo.
Maya na natin i-implement dun sa guessing game natin. Pero dahil madali lang sya, explore nyo na.
Next topic: implementing the reading of a text ro the game
Code:
f = open('file.txt')
f.write('Text as string')
#para ma read yung Argument #1 sa f.write, ito gagamitin natin.
f.readline() #output nito ay string.
#or
line_text = f.readline()
print(line_text)
#easy diba.
Next topic: implementing the reading of a text ro the game