- Mastering Python Scripting for System Administrators
- Ganesh Sanjiv Naik
- 39字
- 2021-07-02 14:00:20
Updating strings
We can update a string by reassigning a new value to the specified index. Refer to the following example:
#!/usr/bin/python3
str1 = 'Hello Python!'
print ("Updated String: - ", str1 [:6] + 'John')
Output:
Updated String: - Hello John
推薦閱讀
- PHP動態網站程序設計
- Cocos2d Cross-Platform Game Development Cookbook(Second Edition)
- Dynamics 365 for Finance and Operations Development Cookbook(Fourth Edition)
- Java程序設計與開發
- 移動UI設計(微課版)
- Game Programming Using Qt Beginner's Guide
- BeagleBone Media Center
- ASP.NET 3.5程序設計與項目實踐
- Getting Started with NativeScript
- C# 8.0核心技術指南(原書第8版)
- HTML5從入門到精通 (第2版)
- PLC應用技術(三菱FX2N系列)
- INSTANT Yii 1.1 Application Development Starter
- Python Data Science Cookbook
- PHP 7從零基礎到項目實戰