Ciao!se io ho un numero float,come posso arrotondarlo?c'è qualke funzione??
sì, la funzione round():
round( x[, n])
Return the floating point value x rounded to n digits after the decimal point. If n is omitted, it defaults to zero. The result is a floating point number. Values are rounded to the closest multiple of 10 to the power minus n; if two multiples are equally close, rounding is done away from 0 (so. for example, round(0.5) is 1.0 and round(-0.5) is -1.0).
>>> pi=3.1415926535
>>> round(pi,2)
3.1400000000000001
se invece vuoi convertire in int arrotondando, puoi fare
intero=int(float+0.5)
per finire, a volte conviene arrotondare solo in fase di output, e quindi puoi usare l'operatore di formattazione '%f'

>>> pi=3.1415926535
>>> print "%1.3f" % pi
3.142

Connesso
#!/usr/bin/env python
(you,love,me)=('Madein zAr','0-*1+).()-/,-,',len('.signature')<<1)
print ''.join([you[give-me] for give in [ord(er)-me for er in love]])