-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.py
More file actions
69 lines (60 loc) · 914 Bytes
/
script.py
File metadata and controls
69 lines (60 loc) · 914 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
62
63
64
65
66
# hello world program
print("hello world!")
# indentation
x = 1
if x == 1:
print("x is 1.")
# variables and types
# numbers
pyint = 7
print(pyint)
# float
pyfloat = 7.0
print(pyfloat)
pyfloat = float(7)
print(pyfloat)
# strings
mystring = "dont know how to create a string"
print(mystring)
one = 1
two = 2
three = one + two
print(three)
hello = "hello"
world = "world"
helloworld = hello + " " + world
print(helloworld)
a, b = 3, 4
print(a, b)
one = 1
two = 2
hello = "hello"
print(one + two)
# list
mylist = [1, 2, 3]
mylist.append(hello)
mylist.append(world)
print(mylist)
for x in mylist:
print(x)
pylist = [1, 2, 3]
# Arithmetic Operators
a = 2 + 3
b = 2 - 3
c = 2 * 3
d = 2 / 3
e = 2 % 3
f = 2 ** 3
g = 2 & 3
h = 2 ^ 3
print(a + b)
print(a - b)
print(a * b)
print(a / b)
print(a % b)
print(a ** b)
print(a & b)
print(a ^ b)
print(a | b)
helloworld = "hello" + " " + "world"
print(helloworld)