-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello_python.py
More file actions
61 lines (42 loc) · 923 Bytes
/
Copy pathhello_python.py
File metadata and controls
61 lines (42 loc) · 923 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
print("Hello Python")
# Semi-Colons bad.
# White Space matters. A lot. indents/tabs/spaces vs {}
# Dybamic Variables/Loose Typing
# none vs null
# Compiled vs Interpereted
# Variables
a = 10
b = 25.5
print(a+b)
b = "ralph"
print (b)
# Concatenating Strings & Numbers
print(str(a) + b)
print(float(a))
# If we can't guarentee the type of a variable
# How can we check the type during runtime
some_var = 10 # int
theType = type(some_var)
print(theType)
if(type(some_var) == int):
print("The var is an int")
else:
print("The var is NOT an int")
# Strings
name = "Ralph"
lName = 'Wiggum'
html = "<div> class=''></div>"
html = '<div class=\"redBox\"></div>'
print(html)
print(name + " " + lName)
# Multi-line Strings
html = """
<span>
<h2>Hello</h2>
</span>
"""
"""Strings
Multi-line Strings Comments"""
# Format Strings
fullName = name + " " + lName
fullName = f"Hello {name} {lName}"