Write a method in python to display the elements of list thrice if it is a number and display the element terminated with ‘#’ if it is not a number.
For example, if the content of list is as follows :
mylist = ['41','DROND','GIRIRAJ', '13','ZARA']
The output should be
414141
DROND#
GIRIRAJ#
131313
ZARA#
Source Code
def fun(mylist):
for value in mylist:
if value.isdigit():
print(value*3)
else:
print(value+'#')
mylist = ['41','DROND','GIRIRAJ', '13','ZARA']
fun(mylist)
Output
414141
DROND#
GIRIRAJ#
131313
ZARA#