Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

capwords python

# imports string module
import string
sentence = 'Python is one of the best programming languages.'
# sep parameter is left None
formatted = string.capwords(sentence, sep = None)
print(formatted)
# Output: Python Is One Of The Best Programming Languages.


# imports string module
import string 
sentence = 'Python is one of the best programming languages.'
# sep parameter is 'g'
formatted = string.capwords(sentence, sep = 'g')
print('When sep = "g"', formatted)
# sep parameter is 'o'
formatted = string.capwords(sentence, sep = 'o')
print('When sep = "o"', formatted)
# Output: When sep = "g" Python is one of the best progRamming langUagEs.
# 		  When sep = "o" PythoN is oNe oF the best proGramming languages.
Comment

PREVIOUS NEXT
Code Example
Python :: textclip python arabic 
Python :: groupby and sort python 
Python :: python edit global variable in function 
Python :: how to find in which directory my python code is running 
Python :: how to remove duplicates from a python list 
Python :: django render template 
Python :: most frequent word in an array of strings python 
Python :: read json in python 
Python :: [0] * 10 python 
Python :: pandas dataframe replace inf 
Python :: pythob password generator 
Python :: How to round to 2 decimals with Python? 
Python :: access django server from another machine 
Python :: python print trailing zeros 
Python :: slug url 
Python :: how to change index date format pandas 
Python :: shape pandas 
Python :: pandas save dataframe to csv in python 
Python :: python list for all months including leap years 
Python :: discord py check if user has permission return message if not 
Python :: python property 
Python :: virtualenv python2 
Python :: python pillow cut image in half 
Python :: python if condition assignment in one line 
Python :: camel case in python 
Python :: Python program to draw hexagon 
Python :: asyncio run 
Python :: python json web request 
Python :: xargs to copy file from text files to another directory 
Python :: django or 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =