Skip to content

Latest commit

 

History

History
54 lines (28 loc) · 927 Bytes

ex22.md

File metadata and controls

54 lines (28 loc) · 927 Bytes

print(s): print string s to screen.

+: addition

-: subtract

*: multiply

/: divide

%: modulus

<: less than

>: greater than

<=: less than equal to

>=: greater than equal to

f"{a}": format string with a injected into it

\n: newline

\t: tab

"""""": multiline string

"": string literal

{}: format string placeholder

input(prompt): get keyboard input

sys: library to interact with the interpreter

argv: part of sys library to get command line arguments

open(file, flag): return a file object

file.read(): read contents of a file

file.write(string): write string to a file

file.close(): close a file object

file.seek(0): go to beginning of file

file.truncate(): erase a file

with open(from_file) as f: [filestuff]: do file operation with context manager.

*args: list of arguments to a function