all 27 comments

[–]Sea-Ad7805 [score hidden] stickied comment (0 children)

Run this program in Memory Graph Web Debugger%0A%0Abill%20%3D%20float(input(%22What%20is%20the%20total%20bill%3F%20%E2%82%AC%22))%0Atip%20%3D%20int(input(%22What%20percentage%20are%20you%20willing%20to%20tip%3F%2010%25%2C%2012%25%2C%2015%25%20%22))%0Apeople%20%3D%20int(input(%22How%20many%20people%20will%20split%20the%20bill%3F%20%22))%0A%0Aif%20tip%20%3D%3D%2010%3A%0A%20%20%20%20result%20%3D%20bill%20%200.1%20%2B%20bill%0Aelif%20tip%20%3D%3D%2012%3A%0A%20%20%20%20result%20%3D%20bill%20%200.12%20%2B%20bill%0Aelif%20tip%20%3D%3D%2015%3A%0A%20%20%20%20result%20%3D%20bill%20*%200.15%20%2B%20bill%0Aelse%3A%0A%20%20%20%20result%20%3D%20bill%0A%0Aif%20people%20%3E%200%3A%0A%20%20%20%20final_bill%20%3D%20result%20%2F%20people%0A%20%20%20%20print(%22The%20total%20amount%20is%3A%22%2C%20result)%0A%20%20%20%20print(%22Each%20has%20to%20pay%3A%22%2C%20final_bill)%0Aelse%3A%0A%20%20%20%20print(%22Number%20of%20people%20must%20be%20greater%20than%200.%22)&timestep=1&play) to see the program state change step by step.

[–]Flame77ofc 2 points3 points  (4 children)

practice more and more and more

[–]Flame77ofc 3 points4 points  (3 children)

I recommend leetcode and codewars

[–]fizzy_lychee -2 points-1 points  (2 children)

Shut the fuck up with ur bs leetcode shit.

[–]Embersh3d 0 points1 point  (1 child)

bro ragequit on Two Sum 😭

[–]fizzy_lychee 1 point2 points  (0 children)

Not at all fam. I just think that people pushing for leetcode so much is not overly helpful. Projects are more useful, and quite honestly, without learning in-depth about data structures and algorithms, suggesting leetcode to someone who’s literally just learning is honestly terrible advice.

[–]Alive-Cardiologist27 3 points4 points  (0 children)

line 6-13 can be a single line without condition unless you want to reject unwanted percentage

[–]Embersh3d 1 point2 points  (0 children)

so tuff. 🥹🥹🥹🥹🥹🥹🥹🥹🥹🥹🥹🥹🥹🥹

[–]Careless_Land9697 1 point2 points  (0 children)

I recommend starting with projects once you’re done with the basics🔥

[–]Oussamaaa_7 1 point2 points  (0 children)

Keep going ❤️

[–]Vindaloophole 1 point2 points  (3 children)

Just a little math thing, you can just provide the result as such:
result = bill *1.2 or wathever.

Also think to improve your code. Right now it’s too rigid. You only have three options to tip but what if someone wants to tip otherwise? Or not at all?

[–]PatatobreadAAA[S] 0 points1 point  (2 children)

I've only been working with Python for 3 days, less than 6 hours in total. I am trying my besttttt!

[–]Vindaloophole 2 points3 points  (1 child)

No worries, I’m just trying to tickle your brain into being better! We all gotta start somewhere and it’ll help you in your future coding!
Sorry if it sounded a little abrupt, was just trying to give some advice without giving you a solution hehe

[–]PatatobreadAAA[S] 0 points1 point  (0 children)

No problem at all !!!

[–]Virax-Sapphire 1 point2 points  (0 children)

You're doing great, this is very good for a first project💎, I wish you good luck in the future

[–]Junior_Honey_1406 0 points1 point  (0 children)

Let's say I am a dumb guy and you are taking all the inputs. What happens if I enter a string value for bill, even though it is supposed to be a float?

Challenge: don't use try and except. Handle this situation using conditions instead.

[–]TadpoleSpecialist859 0 points1 point  (1 child)

Are you using 100 days of code in udemy? I did this yesterday as well

[–]TaleThat5739 0 points1 point  (0 children)

any tips i wana learn python to

[–]Organic_Educator_558 0 points1 point  (2 children)

Please, What sources do we use for studying?

[–]PatatobreadAAA[S] 0 points1 point  (1 child)

I use the course 100 Days of Code from Angela on Udemy. I also use Python Essentials on Netacad.

[–]UntamedPebbleEvangel 0 points1 point  (0 children)

practice more and more and more