- Please install Python 3.5 https://www.python.org/downloads/
- https://www.youtube.com/watch?v=HBxCHonP6Ro
- https://www.youtube.com/watch?v=hnxIRVZ0EyU
- https://www.youtube.com/watch?v=nefopNkZmB4
- https://www.youtube.com/watch?v=YbipxqSKx-E
- https://www.youtube.com/watch?v=1yUn-ydsgKk
- https://www.youtube.com/watch?v=bk22K1m0890
- https://www.youtube.com/watch?v=llguiJHU0kk
- https://www.youtube.com/watch?v=Neir-vgPyxw
- https://www.youtube.com/watch?v=k6rkvgQkW04
- https://www.youtube.com/watch?v=68EhtQbgXRc
- https://www.codecademy.com/courses/introduction-to-python-6WeG3/0/3
- https://www.codecademy.com/courses/python-beginner-GB6hM/0/1
- https://www.codecademy.com/courses/python-beginner-sRXwR/0/1
- https://www.codecademy.com/courses/python-beginner-BxUFN/1/1
print('Hello world')
1
0
123
-1
1.1
1.0
1 + 1
2 - 1
3 * 4
1 / 2
1 / 0
1 // 2
1 % 2
2 ** 10
(1 + 3) * 4
a = 1
a
a = a + 1
a += 1
a == 2
True
False
1 < 2
1 > 2
1 == 2
1 != 2
True or False
True and False
not True
type(1)
type(1 == 1)
"alma"
""
type("alma")
"alma" + "fa"
"alma" - "fa"
"alma" + 3
"alma" + str(3)
"alma" * 3
"a" in "alma"
len("alma")
"alma"[1]
"alma"[1:3]
int("123")
[1, 2, 3]
[]
[1, 2] + [3]
[1] - [2]
[1, 2] * 3
1 in [1, 2]
len([1, 2, 3])
arr = [1, 2, 3]
arr[0]
arr[1:3]
[] is []
None
if a == 2:
print(a)
if a == 2:
print("two")
else:
print("other")
if a == 1:
print("one")
elif x == 2:
print("two")
else:
print("a lot")
if a == 1:
pass
else:
print("not one")
a = 0
while a < 5:
a += 1
print(a)
for i in [1, 2, 3, 4]:
print(i)
for i in range(0, 4):
print(i)
Please redo the While excercises with for
numbers = [5, 7, 9, 11, 13, 12]
i = 0
while i < len(numbers):
if numbers[i] % 3 != 0:
pass
else:
print(numbers[i])
break
i += 1
numbers = [5, 7, 9, 11, 13, 12]
i = 0
while i < len(numbers):
if numbers[i] % 3 != 0:
continue
else:
print(numbers[i])
i += 1