Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
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.
Glimpse Of Numpy Python
http_request
daily score
on_off
Chain length calculator
information of operating system on which your code is run
Dictionary
Roman numrals
my shopping list at supermarket
Aisha Lesson 2
Please log in to post a comment.