Can anyone help me in the Solution of hovercraft | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can anyone help me in the Solution of hovercraft

Python https://code.sololearn.com/c1TizQ096r79/?ref=app

22nd Aug 2020, 2:04 PM
Blue Dot.
Blue Dot. - avatar
9 Answers
+ 6
https://code.sololearn.com/cZvlMA9B7A9R/?ref=app
22nd Aug 2020, 3:19 PM
Namit Jain
Namit Jain - avatar
+ 5
Use the exact word as given in the question! Instead of "it's a profit" write "Profit" Instead of "it's a loss" write "Loss" And for the case of 7 show "Broke Even"
25th Aug 2020, 7:27 AM
Namit Jain
Namit Jain - avatar
+ 3
First of all, you are making 10 hovercrafts each of 2,000,000. And also pay 1,000,000 for insurance. So your total cost will be: = (2,000,000 × 10) + 1,000,000 = 21,000,000 The number of hovercrafts will be input as an integer. Let's call it num. Now you sell them for 3,000,000 each. So the total money you make will be: = 3,000,000 × num You can check for the following conditions and output accordingly: 1. If the money made is greater than the total cost, you've made a profit. 2. If it's lower, you made a loss. 3. If both are equal, it's a broke even I would encourage you to write the code by yourself.
22nd Aug 2020, 2:25 PM
Ali Shah Jindani
Ali Shah Jindani - avatar
+ 2
Ali shah jindani thank you .I intend to do it myself I am having trouble picturing it I'm originally not a math Student . Thank you once again.
24th Aug 2020, 6:26 AM
Blue Dot.
Blue Dot. - avatar
24th Aug 2020, 7:50 AM
Namit Jain
Namit Jain - avatar
+ 2
Thank you Namit jain I actually did write profit ,loss and broke even but it did not work then i looked deeper , my mistake was that it was all in lower case alphabets....
25th Aug 2020, 12:26 PM
Blue Dot.
Blue Dot. - avatar
+ 1
Blue Dot. I'm glad you liked the explanation. If you face any difficulty in writing the code, feel free to ask. And don't worry if you were unable to picture it. You'll get better with practice.
24th Aug 2020, 8:11 AM
Ali Shah Jindani
Ali Shah Jindani - avatar
+ 1
I tried doing it my self it took me about 90 mins thank you for all of your help... do check it out https://code.sololearn.com/ceU0aKP7rAnw/?ref=app
25th Aug 2020, 7:19 AM
Blue Dot.
Blue Dot. - avatar
+ 1
And could you all tell me why is this code wrong when it does the same thing i also corrected all the print functions namely too broke even, profit and loss
25th Aug 2020, 7:22 AM
Blue Dot.
Blue Dot. - avatar