-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudyDrills.txt
40 lines (36 loc) · 941 Bytes
/
studyDrills.txt
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
Ex4
1. Using 4 instead of 4.0 gives 120 instead of 120.0.
2. Floating point means that it will give an approximation of a number
3. comments for variables
4. One equals is a variable assignment
5. "_" is a way of writing variables
6. Used python as a calculator
Ex5
1. Deleted all of the my_ with a regex replacement
2. %r
3. Other formatting characters:
%s string
%d decimal conversion
%e exponential format
%E uppercase E
%g general number; uses $d if it fits otherwise %e
%G E if necessary
%o octal (base 8)
%x hex
%X capital A-F
%c integer to character
%% percent sign
Deprecated as of python 2.6
use instead .format()
4. Code also outputs centimeters and kilos
Ex6
1. Added comments
2. I found six
3. Each time a % sign is used is where a string is put inside another string
4. '+' for strings is a concatenations
Ex7
1. Added comments
Ex11
1. raw_input() uses the next string input and assigns it to a variable
2.
4.