PYTHON Programming Language. In 8 Hours, For Beginners, Learn Coding Fast! Python Crash Course, A QuickStart eBook, Tutorial Book with Hands-On Projects, In Easy Steps! An Ultimate Beginner's Guide! by Yao Ray

PYTHON Programming Language. In 8 Hours, For Beginners, Learn Coding Fast! Python Crash Course, A QuickStart eBook, Tutorial Book with Hands-On Projects, In Easy Steps! An Ultimate Beginner's Guide! by Yao Ray

Author:Yao, Ray [Yao, Ray]
Language: eng
Format: epub, mobi, pdf
Publisher: Python programming zelle in a nutshell onesie kids coding learning 5th edition in your pocket programming quick reference card
Published: 2019-09-06T16:00:00+00:00


String Functions (2)

Functions

Returned Strings

separater.join()

join the strings by separator

str.swapcase()

swap the letter case of the string

str.zfill(length)

add zeros to the left of the string with length

Example 5.9

strDate = "/".join(["12", "31","2013"])

print (strDate)

str = "Python"

print (str.swapcase() )

print (str.zfill(10))

Output:

12/31/2013

pYTHON

0000Python

Explanation:

“"/". join(["12", "31","2013"])” separates the date string by “/”.

“str.swapcase()” changes “Python” to “pYTHON”

“str.zfill(10)” fills “0” to the string with length “10” on the left.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.