-
Notifications
You must be signed in to change notification settings - Fork 0
/
code_academy_notes
80 lines (61 loc) · 1.77 KB
/
code_academy_notes
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
70
71
72
73
74
75
76
77
78
79
80
"""**********************
There are samples and descriptions that I collect from different free code education websites to remember always
**********************
"""
"""**********************
parrot = "Norwegian Blue"
print("Norwegian Blue".lower())
**********************
"""
"""**********************
parrot = "norwegian blue"
print("norwegian blue".upper())
**********************
"""
"""**********************
"""Declare and assign your variable on line 4,
then call your method on line 5!"""
pi = 3.14
print(str(pi))
**********************
"""
"""**********************
Dot Notation
Let’s take a closer look at why you use len(string) and str(object), but dot notation (such as "String".upper()) for the rest.
lion = "roar"
len(lion)
lion.upper()
Methods that use dot notation only work with strings.
On the other hand, len() and str() can work on other data types.
**********************
"""
"""**********************
ministry = "The Ministry of Silly Walks"
print(len(ministry))
print("The Ministry of Silly Walks".upper())
**********************
"""
"""**********************
my_string = "Bu kutuyu ilk siz aciyorsunuz."
print(len(my_string))
print(my_string.upper())
**********************
"""
"""**********************
On line 13, assign the variable fifth_letter equal to the fifth letter of the string “MONTY”.
Remember that the fifth letter is not at index 5. Start counting your indices from zero.
fifth_letter = "MONTY"[4]
print fifth_letter
**********************
"""
"""********************** Old Type
string_1 = "Camelot"
string_2 = "place"
print "Let's not go to %s. 'Tis a silly %s." % (string_1, string_2)
#Let's not go to Camelot, 'Tis a silly place
**********************
"""
"""**********************
https://projecteuler.net/archives
**********************
"""