@BenTerry/

Strings

Python

this repl is the absolute mad lads or the road men of the 19th century

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
# The string is assigning the string in memory
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).")

#data in varible is storing a list

listOrArray = ['ArrayString', '2', 4, 'end of array']

print(string[0:40:3])
print(listOrArray[0:3])
#the list
thirdInList = listOrArray[2]

print(thirdInList)
#the list im printing
twoDArray = [["fiat", "500"], ["VW", "golf"], ["BMW", "3 Series"]]
#printing the text 
print(twoDArray[1])
print()
print(twoDArray[2][1])