Python Write sample code for functions in .
The sample code is as follows :
def washing_maching():
print(' Water injection ')
print(' wash ')
print(' Rinse ')
print(' dehydration ')
print(' dry ')
washing_maching()
The operation results are as follows :
The sample code is as follows :
def washing_maching(mode):
print(' Water injection ')
if mode == 'soft':
print(' Gentle washing ')
elif mode == 'hard':
print(' Strong washing ')
else:
print(' Ordinary washing ')
print('\n')
washing_maching('soft')
washing_maching('hard')
washing_maching('noraml')
The operation results are as follows :
The sample code is as follows :
def area(radius):
result = radius*radius*3.14
return result
area_5 = area(5)
The operation results are as follows :