Notes on Python again


Please see some notes at here: https://helloacm.com/notes-on-python-syntax/

Python is great, when I learn more, I really find it flexible and powerful.

1. Initialise one dimension array by zeros

x = [0] * 5

2. range() with single parameter

print range(3)

3. Initialise two dimension array by zeros

x=[[0 for col in range(3)] for row in range(2)]

pnotes Notes on Python again beginner implementation python technical tricks

4. Convert number to string

x = [1, 2, 3, 4]
y1 = [str(a) for a in x]
y2 = map(str, x)
y3 = [`a` for a in x]

–EOF (The Ultimate Computing & Technology Blog) —

GD Star Rating
loading...
163 words
Last Post: Simulated Annealing
Next Post: Linux Shell Programming - yes

The Permanent URL is: Notes on Python again

Leave a Reply