23 Answers
New Answer23 Answers
New AnswerAbhay Rik Wittkopp heres my code: paintn = int(input()) cost = 40 + paintn*5 tax = cost /10 price = cost + tax if int(price) != price: print(price) else: print (int(price)) and the link https://sololearn.com/coach/22/?ref=app
Abhay I think that 7 is for experimental and testing the code. If no input is given, it will use 7 instead.
Well done Abhay Struggling with internet connectivity here. Swift may I suggest you review import math math.ceil() Round() in Python can round up or round down, but the challenge specifies rounding up, so ceil() is what you will need. PS: There are other ways to do this also
Swift question mentions "rounded up" to the nearest whole number. import math paintn = int(input()) cost = 40 + paintn*5 tax = cost /10 price = cost + tax print(math.ceil(price))
Shreyash(S&O CODERS) i mean the numbers that have n.0 not the ones that have a decimal value
Shreyash(S&O CODERS) don't post your question under others question , Follow the guidelines , https://www.sololearn.com/Discuss/1316935/?ref=app
Rik Wittkopp I have done this way only and if you don't mind can you show what other ways you are talking about ?
Abhay paintn = int(input() or 7) cost = 40 + paintn*5 tax = cost /10 price = cost + tax print(price) # Avoiding math.ceil() if price %1 !=0: print(price//1 +1)
You don't even need if and math.ceil to solve this code coach. 😉 Here's is my code brush= int(input("")) costb=brush*5 total=costb+40 tax=total/10 costt=total+tax print(round(costt)) https://www.sololearn.com/coach/22?ref=app
Swift Your question is not clear. Can you please describe your challenge and attach your attempt. Also please specify which language you are using. Apologies: You have already specified Python
Abhay as Cyan has stated, 7 is a default input used if no user input. I use it for testing and for setting an example
SoloLearn Inc.
4 Embarcadero Center, Suite 1455Send us a message