- In Python, a string of text can be aligned left, right and center.
.ljust(width):
- This method returns a left-aligned string of length width.
>>> width = 20
>>> print 'HackerRank'.ljust(width,'-')
HackerRank----------
>>> width = 20
>>> print 'HackerRank'.ljust(width,'-')
HackerRank----------
>>> print 'ab123'.isalnum()
True
>>> print 'ab123#'.isalnum()
False
>>> string = "abracadabra"
Hello firstname lastname! You just delved into python.
Function Description:>>> a = "this is a string"
>>> a = a.split(" ") # a is converted to a list of strings.
>>> print a
['this', 'is', 'a', 'string']
Joining a string is simple:>>> a = "-".join(a)
>>> print a
this-is-a-string
Www.HackerRank.com → wWW.hACKERrANK.COM
Pythonist 2 → pYTHONIST 2
>>> any([1>0,1==0,1<0])
True
>>> any([1<0,2<1,3<2])
False
In this post, we will look at how we can deploy our Django app using the Microsoft Azure app service - a free plan. You need an Azure accoun...