-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex22.txt
More file actions
69 lines (36 loc) · 2.17 KB
/
ex22.txt
File metadata and controls
69 lines (36 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
print - this just prints the value of a variable or a string when its around quotes
# - octothorp - this is the start of a one line comment. anything after it considered as a comment and will be ignored by the
compiler
+ -plus- this adds two numbers together or concatenate two words
, -comma- this separates variables or numbers or strings
* -asterisk- this multiplies two values together
/ -slash- this divides two values
- -dash- this subtracts two values
= -equal sign- this is used when setting a variables
" " -double quotes- this is used when you print strings
'' -single quotes- this is also used when printing strings or usually used when setting string variables to something
f - this is used when you have some variable to print using {}
() -parenthesis- this is used when printing statements or when you perform calculations that need parenthesis.
{} -curly brace- This is used when you print the values of variables inside the ""
false - this is used for booleans if something is false
format - this does the same thing as the curly braces in a print statements
end=' ' - this causes the print statements to not print a new line.
true - this is used in booleans if something is true
""" """ -triple quotes- these quotes are used to print out lines exactly as written. you could write something over a couple
of line and it would print out everything if you used a new line.
\t - this tabs in
\\ - this prints out a single \ since the \ character is a escape character
\n - this prints a new line
input() - this gets user input on the terminal
from - this goes to one of the files or folders on the terminal
import - this imports something from one of the folders in the terminal
argv - this gets a argument vector from when you run the files
open() - this opens a file put doesnt display anything
close() - this closes the file
read() - this reads the thing in the file
readline() - reads just one line of the text
truncate() - this empties the file
write() = this writes things into the file
seek(0) this moves the read/write location to the beginning of the file
*args - this is like the argv but the args can represent two inputs
def() - this defines the function.