2017-01-19Complete
Python Cheat Sheet - Working With Lists
// build log: Python Cheat Sheets
all parts →- 01 Python Cheat Sheet - Working With Lists
- 02 Python Cheat Sheets: Uncommon Methods
Working with Lists: A quick description of different operations that can be performed on a python list
#Declare a list with 2 initial values
computers = ["ibm", "apple"]
#2 Different ways to add items to my existing list
computers.append ("dell")
computers.insert(0, "gateway")
print("\nA complete list of computers I have worked on")
print(computers)
#Sorted prints the list without changing it, sort modifys the list
print("\nA sorted list of computers I have worked on")
print(sorted(computers))
computers.sort()
print(computers)
print("")
#A loop to print each item in title case
for computer in computers:
print(computer.title())
computers.pop()
computers.remove("gateway")
print(computers)
#Slicing
print(computers[0:1])
#Print Last
print(computers[-1])
// more in Code
◆ Complete
2017-02-19·portfolio / code / exfs
Python Image Rotation Correction Script (EXFS Data Editing)
This script is written in python to perform EXFS corrections of digital photos. This script traverses the specified directory, stores all images, then…
◆ Complete
2017-02-18·code / python / programming
Image Magic: Python Powered Digital Photo Frame On Raspberry Pi
I was looking for a quick way to scan every photo on my media server, and display them one at a time in a photo slideshow. I wanted a python program to…
◆ Complete
2017-01-21·news
Python Cheat Sheets: Uncommon Methods
This is a quick list of uncommon methods in Python. #Set Method - Eliminates duplicates set(my_list)