How to get number without decimal places?

decimal, python

Solution

Just convert the number with `int`:

print('Teie nädalapalk on {}'.format(int(tunnid * tasu * 1.5)))

Alternatively, you can use the `format` mini-language:

print('Teie nädalapalk on {:.0f}'.format(tunnid * tasu * 1.5))

The `.0f` tells the number to be truncated to 0 decimals (i.e. integer representation)

Problem

``` tunnid = int(input("Sisestage oma töötundide arv ühes nädalas: ")) tasu = int(input("Sisestage oma tunnitasu: ")) if tunnid <= 40: print("Teie nädalapalk on " + str(tunnid*tasu)) else: print("Teie nädalapalk on " + str(tunnid*tasu*1.5)) ``` If i multiply 60*10 as else i should get 900, but program gives me 900.0 So my quiestion is, how to remove this .0 from the answer, what do i have to change in my code? p.s Im just a beginner so don't judge please :)

Original source