finished work
This commit is contained in:
parent
2396d73b2f
commit
73ecd7d386
1
answer/1try.txt
Normal file
1
answer/1try.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
ID 2: Data Engineer в Тинькофф, Москва — от 180000 до 250000ID 6: Senior Python Developer в Wildberries, Москва — от 200000 до 300000
|
||||||
@ -56,7 +56,7 @@ def format_vacancy_short(vacancy: dict) -> str:
|
|||||||
else:
|
else:
|
||||||
salary_str = "зарплата не указана"
|
salary_str = "зарплата не указана"
|
||||||
return (f"ID {vacancy.get('id')}: {vacancy.get('title')} в {vacancy.get('company')}, "
|
return (f"ID {vacancy.get('id')}: {vacancy.get('title')} в {vacancy.get('company')}, "
|
||||||
f"{vacancy.get('city')} — {salary_str}")
|
f"{vacancy.get('city')} — {salary_str}\n")
|
||||||
def save_filtered_results(vacancies: list[dict], filename: str) -> bool:
|
def save_filtered_results(vacancies: list[dict], filename: str) -> bool:
|
||||||
try:
|
try:
|
||||||
with open(filename,"w") as file:
|
with open(filename,"w") as file:
|
||||||
@ -73,13 +73,17 @@ def main():
|
|||||||
filered_vacancies=filter_by_skills(filered_vacancies,skils_list)
|
filered_vacancies=filter_by_skills(filered_vacancies,skils_list)
|
||||||
filered_vacancies = filter_by_salary(filered_vacancies,int(input("Write salary: ")))
|
filered_vacancies = filter_by_salary(filered_vacancies,int(input("Write salary: ")))
|
||||||
print("Уникальные компании: ", ", ".join(extract_unique_companies(filered_vacancies)))
|
print("Уникальные компании: ", ", ".join(extract_unique_companies(filered_vacancies)))
|
||||||
|
top_skills = extract_top_skills(filered_vacancies, 5)
|
||||||
|
print(f"Топ-5 навыков:")
|
||||||
|
for skill, count in top_skills:
|
||||||
|
print(f" {skill}: {count} вакансий")
|
||||||
|
print(f"\nСредняя зарплата: {calculate_average_salary(filered_vacancies):,.0f} руб.")
|
||||||
|
for company, count in group_by_company(filered_vacancies).items():
|
||||||
|
print(f" {company}: {count} вакансий")
|
||||||
|
if(save_filtered_results(filered_vacancies,input("Write where to save"))):
|
||||||
|
print("Check your path")
|
||||||
|
else:
|
||||||
|
print("Everything is fine, the file is saved")
|
||||||
if __name__ =="__main__":
|
if __name__ =="__main__":
|
||||||
#вход проги
|
#вход проги
|
||||||
main()
|
main()
|
||||||
Loading…
Reference in New Issue
Block a user