Skip to content

Vika_task2_find_the_cheapest_book - #64

Open
victoriazubyk wants to merge 1 commit into
masterfrom
vika_task2_cheapest_book
Open

Vika_task2_find_the_cheapest_book#64
victoriazubyk wants to merge 1 commit into
masterfrom
vika_task2_cheapest_book

Conversation

@victoriazubyk

Copy link
Copy Markdown
Collaborator

Add task 2

@UkrainianEngineer

Copy link
Copy Markdown
Owner

It's not clear from the name of pull request what it is about.
Please fix it and try to avoid such names.

{'name': 'Harry Potter','price': 1300},
{'name': 'Fluent Python','price': 650}]

val=[]

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please try to use spaces, new lines, etc. according to PEP 8 recommendations:
https://www.python.org/dev/peps/pep-0008/


for elem in books:
for key,value in elem.items():
if key=='price':

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix spaces.

Why do you need all prices in one list?
Isn't it possible to add price, name in one loop? Just to avoid moving through the list twice?


m=min(val)

for elem in books:

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bad idea to iterate through the same list twice.

Please try to fix this logic somehow.

@victoriazubyk victoriazubyk changed the title added task 2 Vika_task2_find_the_cheapest_book Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants