[Beginner] Python array

Try using arrays in Python

If you do not specify anything in split (), it will create a list separated by spaces.


>>> s1 = "The quick brown fox jumps over the lazy dog."
>>> s_list = s1.split()
>>> print(s_list)
['The', 'quick', 'brown', 'fox', 'jumps', 'over', 'the', 'lazy', 'dog.']
>>> print(s_list[1])
quick
>>> len(s_list)
9
>>> while i < len(s_list):
	print(s_list[i])
	i += 1

	
The
quick
brown
fox
jumps
over
the
lazy
dog

>>> for w in s_list:
	print(w)


The
quick
brown
fox
jumps
over
the
lazy
dog.

Recommended Posts

[Beginner] Python array
Beginner ABC154 (Python)
Beginner ABC156 (Python)
python beginner memo (9.1)
Python beginner notes
Beginner ABC155 (Python)
[Beginner] Python functions
Beginner ABC157 (Python)
Python array basics
PyQ ~ Python Beginner ~
Python beginner memo (2)
Python beginner Zundokokiyoshi
python numpy array calculation
[python] Array slice operation
Python memo (for myself): Array
Quicksort an array in Python 3
python super beginner tries scraping
Empty multidimensional array in python
Python
Python: 3D array image (numpy.array)
Python beginner launches Discord Bot
Stumble story with Python array
Create a python numpy array
Web scraping beginner with python
[Python beginner] Update pip itself
Atcoder Beginner Contest 152 Kiroku (python)
Python 2D array trap [Copy array]
Subscript access to python numpy array
Let's play with Excel with Python [Beginner]
[Python beginner] Divide one list (5 lines).
Python application: Numpy Part 3: Double array
[Python] How to swap array values
[Beginner] Extract character strings with Python
Python beginner tried 100 language processing knock 2015 (05 ~ 09)
Compare Python and JavaScript array loops
AtCoder Beginner Contest 174 C Problem (Python)
Python beginner tried 100 language processing knock 2015 (00 ~ 04)
kafka python
Python basics ⑤
A note where a Python beginner got stuck
python + lottery 6
Python Summary
Built-in python
Python comprehension
Python technique
Studying python
Python 2.7 Countdown
Python memorandum
Python FlowFishMaster
Python service
python tips
python function ①
Python basics
Python memo
Beginner Kmeans
ufo-> python (3)
Python comprehension
install python
Python Singleton
Python basics ④
Python Memorandum 2