Affiliate link
Python - Print Format
Python provides these built-in functions that you can use on strings for formatting.
| Function | Description | Example |
|---|---|---|
capitalize | Capitalize first character |
String - Get a character with [] index
String - Get substring with slice()
[:][start:][:end][start:end][start:end:step]
<script type="text/javascript">
alert("Hello World, LearnCodeNow!")
</script>String - Combine string with join()
<script type="text/javascript">
alert("Hello World, LearnCodeNow!")
</script>String - Substitute string with replace()
<script type="text/javascript">
alert("Hello World, LearnCodeNow!")
</script>String - Strip string with strip()
<script type="text/javascript">
alert("Hello World, LearnCodeNow!")
</script>Affiliate link
Affiliate link




