This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def validate(num, name): | |
if not num.isnumeric(): | |
raise ValueError(f'Le format de {name} n\'est pas valide') | |
output = int(num) | |
if output < 0 or 100 < output: | |
raise ValueError( | |
f'La veleur de {name} doit être comprise entre 0 et 100') | |
return output | |
a = input('Entrez la valeur de A: ') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rpad# Remove the line below if you want to inherit .editorconfig settings from higher directories | |
root = true | |
# C# files | |
[*.cs] | |
#### Core EditorConfig Options #### | |
# Indentation and spacing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const pagination = (paginationParams = {}) => ({ | |
...paginationParams, | |
limit: paginationParams.limit || 20, | |
offset: paginationParams.offset || 0, | |
totalCount: paginationParams.totalCount || 0, | |
get currentPage() { | |
return Math.floor(this.offset / this.limit) + 1; | |
}, | |
get hasNext() { | |
return this.currentPage * this.limit < this.totalCount; |
OlderNewer