Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PyBoolNone
#python 3.6.9 #PyBoolNone #append() and len() methods' credit goes to pythontutorial.net. Modifications and rest of the code created by Rezaul Hoque on March 14,2022. #contact:jewelmrh@yahoo.com;Dhaka,Bangladesh;https://rezaulhoque.wordpress.com,https://hoquestake.blogspot.com #note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; def append(item, basket=None): if basket is None: basket = [] basket.append(item) return basket basket=['soap','milk','toothpaste'] append('shampoo',basket) #if __len__() is zero bool() constructor returns false otherwise it returns true if basket is not None and len(basket) > 0: for element in basket: print(element) else: print('Basket is empty')
run
|
edit
|
history
|
help
0
Making of floor() and ceil() functions
V
linked_lists_2
new traceback.py
Example for striping string
even odd
Greatest Common Factor (Euclidean algorithm, aka Euclid's algorithm)
Python Unit Test Case Sample
1
Keygen for 010 Editor