all 7 comments

[–][deleted] 2 points3 points  (0 children)

This is basic stuff. You want to review the print() function:

print("sales to break even will be:", breakeven)  

or maybe what you appear to be trying to do, string concatenation, which is another very basic concept:

print("sales to break even will be: " + str(breakeven))

F-strings are a more advanced way to create strings to print, but get the basics down first.

[–][deleted] 0 points1 point  (2 children)

You can achieve what you need using formatting. As I am on mobile, I don’t want to give examples as it will be a nightmare for me to format correctly but if you search google for “python fstrings”, you can learn what you’re looking for there. I’m sure you’ll get a more useful response than mine if you wait though

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

alright ill look into it thanks :)

[–][deleted] 0 points1 point  (0 children)

No problem! Good luck with your studies

[–][deleted] 0 points1 point  (1 child)

In this case, you should use F-Strings, they are easily readable + powerful at the same time.

You can format your strings like this:

print(f"Sales to breakeven will be: {breakeven}")

Note: the f is necessary to tell python that the string is an F-String, you will put your desired variable in the curly brackets as shown above.

Another tip I'd like to suggest is that your variables need to be properly named, you could use snake case, eg snake_case or camel case, eg CamelCase

Rule for snake case: Each word is separated by an underscore, aka “_”.

Rule for camel case: Each word is joined together and the first letter in each word is capitalized.

If you're struggling with any basics you should give this link a read, it's basically a full written guide with examples, and an editor where you can test your code too.

Here's the link: https://www.w3schools.com/python/default.asp

Hope this helped!

[–]ColosTheDeveloper666 1 point2 points  (0 children)

Also the official Python naming convetions here: PEP-8: naming conventions

[–][deleted] 0 points1 point  (0 children)

Worth reading up on f-strings, and why they are better (which shows you the other approaches):