0

Why file modes like "r", "w" are in double quotes in Python

why are the modes used for file operation in double quotes?.Can anyone provide a link detailing where to use parenthesis, double quotes, commas, semi colon etc in python language.Am new to programing

8th Jun 2018, 4:45 AM
Sujith
1 Resposta
+ 1
Because file function needs the argument passed as a string, depending on the function you are using you might need to use tuple or list datatype to pass data to the function. It's dependant on how the given function parses data and uses it in the system itself. you use parentheses to define functions or run them, you pass arguments for functions inside them. they are also used to define tuple datatype ex. tpl = (1,2,3). double quotes are strings. commas are used to separate variables that are passed to a function or separate values in general ex. print(1, "text") semicolon isnt used in py i recommend doing the python tutorial in sololearn to grasp what things are used for
8th Jun 2018, 7:53 AM
Markus Kaleton
Markus Kaleton - avatar