Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

ing or ly add to str

def add_string(str1):
  length = len(str1)

  if length > 2:
    if str1[-3:] == 'ing':
      str1 += 'ly'
    else:
      str1 += 'ing'

  return str1
  
print(add_string('ab'))
print(add_string('abc'))
print(add_string('string'))
Comment

PREVIOUS NEXT
Code Example
Python :: cv2 jupyter notebook matplotlib inverted colors fix 
Python :: genrate requirments.txt pytohn 
Python :: dynamic id python 
Python :: telegram bot python 
Python :: django python get more commands paramaters 
Python :: python datediff days 
Python :: the most effective search algorithm in python 
Python :: how can i get the n values by space separated with condition in python 
Python :: django chain query 
Python :: <h1</h1 
Python :: fastai read data from image folders 
Python :: sanic ip whitelist 
Python :: Horizontal stacked percentage bar chart - matplotlib documentation 
Python :: matplotlib boxplot fill box with pattern 
Python :: wn.synset vs wn.synsets in nltk 
Python :: python check if variable is module 
Python :: Horizontal concatication 
Python :: How to Use the abs() Function in Python? A Syntax Breakdown for Beginners 
Python :: run windows command and get output python 
Python :: how to drag a box on your screen python 
Python :: pd.read_csv how to cumsum a column 
Python :: shutil cut poython 
Python :: site:github.com python ssh 
Python :: apply with sf 
Python :: how to access a variable from another py file in vs code 
Python :: QAction pressed pyqt5 
Python :: djangobook.com jwd django restfremwork plugin 
Python :: Add up the elements in this RDD 
Python :: how to get only non-blank entry of list in python 
Python :: devu and friendship testing codechef solution 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =