-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPythonSyntax
More file actions
46 lines (33 loc) · 975 Bytes
/
PythonSyntax
File metadata and controls
46 lines (33 loc) · 975 Bytes
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
# Float value
float_1 = 0.25
float_2 = 40.0
product = float(float_1) * float(float_2)
print product
big_string = "The product was " + str(product)
print big_string
# Multi string lines
haiku = """The old pond,
A frog jumps in:
Plop!"""
# Updating variables
january_to_june_rainfall = 1.93 + 0.71 + 3.53 + 3.41 + 3.69 + 4.50
annual_rainfall = january_to_june_rainfall
july_rainfall = 1.05
annual_rainfall += july_rainfall
august_rainfall = 4.91
annual_rainfall += august_rainfall
september_rainfall = 5.16
annual_rainfall += september_rainfall
october_rainfall = 7.20
annual_rainfall += october_rainfall
november_rainfall = 5.06
annual_rainfall += november_rainfall
december_rainfall = 4.06
annual_rainfall += december_rainfall
# Two types of division
cucumbers = 100
num_people = 6
whole_cucumbers_per_person = cucumbers/num_people
print whole_cucumbers_per_person
float_cucumbers_per_person = float(cucumbers)/float(num_people)
print float_cucumbers_per_person