Understanding Read Function in hindi python
Python programming मे Understanding read function का use Files से Data को read करने के लिए काम आते है। यह Function Binary made में काम कर सकते है। Python programming मे read function निम्नलिखित है।
1) Open():-
इस Function का use File को open करने के लिए काम आता है।
Syntax :-File = Open ('file.txt', 'r')
2) Read():-
इस Function का use file से Data read या पढ़ने के लिए use किया जाता है।
Syntax :-content = file.read()
3) Readline():-
इस Function का use File से किसी एक line को पढ़ने के लिए काम आता है
Syntax:-line = file.readline()
4) Readlines():-
इस Function का use file मे उपस्थित सभी Data को read करने के लिए इसका उपयोग किया जाता है।
Syntax:-lines = file.readlines()
3) close():-
इस function का use file को clase या बंद करने के लिए किया जाता
Syntax:- file.close()