Unable to solve this question | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Unable to solve this question

Let's imagine you want to buy an ice-cream for 10 of your friends. Write a program that will take the money you have and the price of one ice-cream, and will output the remaining money only if you can buy that ice-cream for your all 10 friends

28th Oct 2020, 8:45 PM
AliHsnRaza Khan
AliHsnRaza Khan - avatar
5 Answers
+ 3
money = int(input()) #Money I have price = int(input()) #Cost of Ice Cream cost = price*10 #Total money needed if cost <= money: print("Money You Have Now:",money - cost ) else: print("You Don't Have Enough Money") #Hope It Helps You 😊
28th Oct 2020, 9:01 PM
Hacker Badshah
Hacker Badshah - avatar
+ 8
Hacker Badshah , I am sure you know the rules of sololearn, that an asker should present his attempt first before we help. It is not recommended to give code for official exercises. The asker may have a benefit when getting a ready to use code and you may get some upvotes. But is does not really help the asker to develop his programming skills. What you can do is to give the asker some hints how the problem can be solved. This is not to blame anyone or whatever else. Thanks for your understanding! Downvotings are accepted ;-)
28th Oct 2020, 9:22 PM
Lothar
Lothar - avatar
+ 7
AliHsnRaza Khan , please don't ask for solutions for this code coach exercise. Before we can help you, please show us your attempt first. You have started to learn from the python tutorial, so may be it would be a good idea to continue learning when you struggle by solving this exercise, or you may repeat some parts of the tutorial. Thanks for your understanding!
28th Oct 2020, 9:04 PM
Lothar
Lothar - avatar
+ 1
Hacker Badshah thanks mate
28th Oct 2020, 9:09 PM
AliHsnRaza Khan
AliHsnRaza Khan - avatar
0
Lothar thanks for your advice. I'll definitely consider it next time.
28th Oct 2020, 9:10 PM
AliHsnRaza Khan
AliHsnRaza Khan - avatar