forked from geekcomputers/Python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request geekcomputers#695 from Brain-0ut/add_file
Add program to translation of sizes of underwear
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# coding: utf-8 | ||
def my_found(req): | ||
my_dict = {'XXS':[42, 36, 8, 38, 24], 'XS':(2), 'S':(4), 'M':(6), 'L':(8), 'XL':(10), 'XXL':(12), 'XXXL':(14)} | ||
if req[0] != 'XXS': answ = my_dict['XXS'][req[1]-1]+my_dict[req[0]] | ||
else: answ = my_dict['XXS'][req[1]-1] | ||
return answ | ||
|
||
country = {1:'Россия', 2:'Германия', 3:'США', 4:'Франция', 5:'Великобритания'} | ||
|
||
print('Программа перевода размеров женского белья из\n' | ||
'международной системы в системы следующих стран:\n' | ||
'1 - Россия, 2 - Германия, 3 - США, 4 - Франция, 5 - Великобритания.\n' | ||
'Справка (международная система): XXS, XS, S, M, L, XL, XXL, XXXL') | ||
|
||
req = [] | ||
while len(req)<=1: | ||
req = list(input('>>> Введите через пробел международный размер и страну,\n' | ||
'в систему которой перевести данный размер: ').split()) | ||
req[0] = req[0].upper() | ||
if len(req)<=1: print('Вы таки что-то сделали не так... \nНужно повторить попытку!') | ||
else:req[1] = int(req[1]) | ||
|
||
print(f'Выбранный Вами размер "{req[0]}" в системе размеров "{country[req[1]]}" будет: {my_found(req)}') |