書名: Mastering Python Scripting for System Administrators作者名: Ganesh Sanjiv Naik本章字數: 41字更新時間: 2021-07-02 14:00:23
Updating lists
You can update elements of lists, as shown in the following code:
#!/usr/bin/python3
cities = ['Mumbai', 'Bangalore', 'Chennai', 'Pune']
print ("Original Value: ", cities[3])
cities[3] = 'Delhi'
print ("New value: ", cities[3])
Output:
Original Value: Pune
New value: Delhi
推薦閱讀
- Beginning C++ Game Programming
- C++ Builder 6.0下OpenGL編程技術
- Instant Zepto.js
- 跟小海龜學Python
- Cassandra Design Patterns(Second Edition)
- NativeScript for Angular Mobile Development
- Windows Presentation Foundation Development Cookbook
- Building Cross-Platform Desktop Applications with Electron
- Flux Architecture
- Python全棧數據工程師養成攻略(視頻講解版)
- Test-Driven Development with Django
- 軟件供應鏈安全:源代碼缺陷實例剖析
- Processing創意編程指南
- Qt5 C++ GUI Programming Cookbook
- 編程可以很簡單