- 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
推薦閱讀
- Learn TypeScript 3 by Building Web Applications
- C語言最佳實踐
- Getting Started with Python Data Analysis
- 全棧自動化測試實戰:基于TestNG、HttpClient、Selenium和Appium
- C語言程序設計上機指導與習題解答(第2版)
- Learning OpenStack Networking(Neutron)(Second Edition)
- 基于SpringBoot實現:Java分布式中間件開發入門與實戰
- C語言程序設計實訓教程與水平考試指導
- Arduino Wearable Projects
- Django Design Patterns and Best Practices
- Secret Recipes of the Python Ninja
- R的極客理想:量化投資篇
- Modular Programming with JavaScript
- Mastering JavaScript Promises
- MySQL數據庫教程(視頻指導版)