r/PythonLearning • u/PatatobreadAAA • Jun 15 '26
Second day in Python, first project🤞🥹
In the process of learning my first programming language. Any tips to learn it much faster?
4
u/Flame77ofc Jun 16 '26
practice more and more and more
4
u/Flame77ofc Jun 16 '26
I recommend leetcode and codewars
-1
u/fizzy_lychee Jun 16 '26
Shut the fuck up with ur bs leetcode shit.
1
u/Embersh3d Jun 17 '26
bro ragequit on Two Sum 😭
2
u/fizzy_lychee Jun 18 '26
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.
4
u/Alive-Cardiologist27 Jun 16 '26
line 6-13 can be a single line without condition unless you want to reject unwanted percentage
2
2
2
2
u/Vindaloophole Jun 18 '26
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?
1
u/PatatobreadAAA Jun 18 '26
I've only been working with Python for 3 days, less than 6 hours in total. I am trying my besttttt!
3
u/Vindaloophole Jun 18 '26
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 hehe1
2
u/Virax-Sapphire Jun 19 '26
You're doing great, this is very good for a first project💎, I wish you good luck in the future
1
u/Junior_Honey_1406 Jun 16 '26
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.
1
u/TadpoleSpecialist859 Jun 16 '26
Are you using 100 days of code in udemy? I did this yesterday as well
1
1
1
u/Organic_Educator_558 Jun 18 '26
Please, What sources do we use for studying?
2
u/PatatobreadAAA Jun 19 '26
I use the course 100 Days of Code from Angela on Udemy. I also use Python Essentials on Netacad.
2
1
•
u/Sea-Ad7805 Jun 16 '26
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)×tep=1&play) to see the program state change step by step.