Learn Python in 100 days thread

Obreh Winfrey

Truly Brehthtaking
Supporter
Joined
Nov 18, 2016
Messages
20,852
Reputation
25,750
Daps
132,009

Mike809

Veteran
Supporter
Joined
Oct 15, 2015
Messages
16,928
Reputation
4,553
Daps
86,880
Reppin
Bronx
GitHub - SnowflakesByTheOZ/Day-15---Coffee-Machine: Coffee machine exercise

What's up, hope yall been good. This is my attempt at Day 15's Coffee Machine exercise. I am a beginner so please highlight any errors I made or indicate areas that I could've improved.

Peace to yall
You have self-repeating code which is what functions are for. Most of the changes in your code seem to be price and order name so just make a function that takes those two as
arguments. You can use something like print(f'not enough funds to purchase {order_name}')

that was just a quick glance as ur code, you can probably notice other things that you can turn into functions.
 

Ski Mask

Friendzone: Collection 1
Joined
Jan 10, 2013
Messages
5,487
Reputation
2,121
Daps
22,064
Reppin
Vegas/seattle
Got this while it was on sale along with the web development course(which im taking now). I should be able to start this by january if my adhd doesn't keep me from finishing my first course on time.
 

Secure Da Bag

Veteran
Joined
Dec 20, 2017
Messages
42,603
Reputation
21,978
Daps
132,564
GitHub - SnowflakesByTheOZ/Day-15---Coffee-Machine: Coffee machine exercise

What's up, hope yall been good. This is my attempt at Day 15's Coffee Machine exercise. I am a beginner so please highlight any errors I made or indicate areas that I could've improved.

Peace to yall

You have self-repeating code which is what functions are for. Most of the changes in your code seem to be price and order name so just make a function that takes those two as
arguments. You can use something like print(f'not enough funds to purchase {order_name}')

that was just a quick glance as ur code, you can probably notice other things that you can turn into functions.

That's the only critique. You should use functions more. Otherwise looks good.
 
Top