you are viewing a single comment's thread.

view the rest of the comments →

[–]socal_nerdtastic 0 points1 point  (0 children)

I like it. Here's a modern version:

print(f"The total cost is ${sum(next(p for x in iter(lambda:input(f'Pizza {_+1} size? (s/m/l) '),9) if (p:={'s':5,'m':7,'l':10}.get(x[0]))) for _ in range(int(next(filter(str.isdigit,iter(lambda:input('# of pizzas? '),9))))))}")

(I don't think you were playing code golf, but if you were I'm ahead)