repl.it
Python

No description

fork
loading
Files
  • main.py
main.py
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
# it assignes the string (in orange) under a variable name "string"
string = (
   "It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like)."
)

listOrArray = ['ArrayString', '2', 4, 'end of array']
# it assignes the list into a variable name "listorarray"

print(string[0:40:3])
# It loads the string and takes every third letter up till letter 40
print(listOrArray[0:3])
# It loads the list and prints every string up till 3

thirdInList = listOrArray[2]
#it finds the third in the list from table

print(thirdInList)
# it prints the third number in the list (4)

twoDArray = ["fiat", "VW", "BMW"]
# creates a "table"that the twoDArray can find from

print(twoDArray[1])
# picks from the table the number in the box
print()
# prints a new line
print(twoDArray[2])
# picks last from table