+ 7
[SOLVED]How to solve coach codes in python?
Why won't sololearn just accept 55.0 instead of 55? And if I change it to int it will outcome other results wrong
22 Respuestas
+ 12
I believe this works
print(round(1.1*(40 + 5 * int(input()))))
+ 7
Abhay 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
+ 7
Abhay
I think that 7 is for experimental and testing the code. If no input is given, it will use 7 instead.
+ 6
Swift looking now
+ 5
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))
+ 5
Abhay thanks, wow!
+ 4
Shreyash(S&O CODERS) don't post your question under others question ,
Follow the guidelines ,
https://www.sololearn.com/Discuss/1316935/?ref=app
+ 4
Abhay do you know what to do?
+ 4
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)
+ 3
wait, if i change codes that have an n.0 end to int will it work?
but how should i do that
+ 3
Shreyash(S&O CODERS) i mean the numbers that have n.0
not the ones that have a decimal value
+ 3
Rik Wittkopp I have done this way only and if you don't mind can you show what other ways you are talking about ?
+ 3
Rik Wittkopp thank you and why do we have number 7 in input() or 7 tho .
+ 3
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
+ 2
Just use PHP
+ 1
I have no idea to how to start python
+ 1
Please give me idea