-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelloworld.py
More file actions
48 lines (32 loc) · 933 Bytes
/
helloworld.py
File metadata and controls
48 lines (32 loc) · 933 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
47
# # Print strings with quotes
# print('Hello World')
# # escape charactrs with \
# print("Hello \"the\" World's")
# # Print multiline
# print('''Hello World''')
# print("""Hello World""")
# print('''
# Hello
# My Name is Karen
# ''')
# # Concatenate string with +
# print("Hello World, " + "What's up?!")
# # strings can only join to strings
# # convert other 'types' to string first with str()
# print("The result of 1 + 1 is " + str(1 + 1))
# integer = whole number
# print(1)
# float = fractional number
# print(2.2)
# adding integer to float results in float type
# print(1 + 2.0)
# Python variables typically use snake_case_variable_names
# all lowercase letters with words separated by undrscores
# first_name = "Karen"
# print(first_name)
# concatenation works with variables also
# print("Hello, " + first_name)
first_number = 10
second_number = 20
the_answer = first_number + second_number
print(the_answer)