+ 1
Why does every time I try to change the variable into a flaot it doesn't work pls help me!
https://sololearn.com/compiler-playground/cq8x9BRfOfmo/?ref=app
2 Answers
+ 9
Abu ANTAR ,
there are some issue to fix:
> the `price..` variables are strings that contain digits and also the currency (âŹ) symbol.
remove the currency from the `price..` variables, and use int values or float values if you like.
> now we can do a calculation wth the the `price` variables
> for the output it is recommended to use f- strings. this enables us to manage
the appearance of the digital places from the values and also the currency symbol
in general the complete code looks a bit too verbose with all the print() statements
+ 2
definently do what Lothar said, especially the f-strings.
https://www.w3schools.com/JUMP_LINK__&&__python__&&__JUMP_LINK/python_string_formatting.asp