Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions printNumbers/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#

CONST_VERSION = 'V1.0'
CONST_VERSION_STRING = '+ + PrintNumbers ' + CONST_VERSION + ' (Software Development in Science) + +'
CONST_VERSION_STRING = f'+ + PrintNumbers {CONST_VERSION} (Software Development in Science) + +'
CONST_DEF_OPERAND_VAL = 10
CONST_MAX_OPERAND_VAL = 20
CONST_FUNC_CODE_FIBONACCI = 0
Expand All @@ -51,9 +51,9 @@ def operand(self):
@operand.setter
def operand(self, n):
if n <= 0 or n > CONST_MAX_OPERAND_VAL:
print('Error: Operand out of range: 0 < <operand> <=', CONST_MAX_OPERAND_VAL)
print(' The default value ( n =', CONST_DEF_OPERAND_VAL, ') is used.')
print('')
print(f'Error: Operand out of range: 0 < <operand> <= {CONST_MAX_OPERAND_VAL}')
print(f' The default value ( n = {CONST_DEF_OPERAND_VAL} ) is used.')
print(f'')
n = CONST_DEF_OPERAND_VAL
self.__operand = n

Expand All @@ -66,8 +66,8 @@ def functionIndex(self, value):
self.__functionIndex = value

def PrintParameters(self):
print('Following Parameters are in use:')
print('--------------------------------')
print('Function Code: ', self.functionIndex)
print('Operand value: ' + str(self.operand))
print('')
print(f'Following Parameters are in use:')
print(f'--------------------------------')
print(f'Function Code: {self.functionIndex}')
print(f'Operand value: {self.operand}')
print(f'')
4 changes: 2 additions & 2 deletions printNumbers/printNumbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@

# Print results depending on the executed function.
if params.functionIndex == CONST_FUNC_CODE_FIBONACCI:
print('fib(' + str(params.operand) + ') =', result)
print(f'fib({params.operand}) = {result}')
elif params.functionIndex == CONST_FUNC_CODE_FACTORIAL:
print(str(params.operand) + '! =', str(result))
print(f'{params.operand}! = {result}')