Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Aisha Wall
# Example of data structure - list oldList = [2, 6, 'jim', True] newList = [False, 'contents', 78] # based on the index - start from 0 listCities = ['Doha', 'Dafna', 'Wakra'] newCity = ['Duhail'] newList = listCities + newCity # Method examples for list DS # - .append(item) # - .insert(pos, item) listCities.insert(2,newCity[0]) # Example of data structure - string str1 = "Wakrr Wakra Wakra." str2 = "DOHA" print str1 print str1.upper() print str2.lower() print str1.find('ra') # Method examples for string DS # - .upper() # - .lower() # - .find(item)
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Python
functional python - from hackernoon.com, lean functional python in 10 min
Numbers padding in Python
GayChicken
Rectangle Area
PyEnum
building a basic calculator
single_digit
Fold an array
PyClass2
Please log in to post a comment.