• Courses
  • Code Compiler
  • Discuss
  • Pricing
  • Teams
Menu
+ 3

why (round (2.675,2))=2.67?

print (round(1.5)) #2 print (round (2.665)) #3 print (round (2.665,2)) #2.67 print (round (2.675,2)) #2.67(why not 2.68?)

python3functionround
4th May 2021, 5:30 PM
Avro
Avro - avatar
1 Answer
+ 1
It's not an error. Check the python docs: https://docs.python.org/3/library/functions.html#round Also compare to numpy.round(): https://code.sololearn.com/cEzK1wGDSAXW/?ref=app
4th May 2021, 5:33 PM
Lisa
Lisa - avatar

Often have questions like this?

Learn more efficiently, for free:

  • Introduction to Python

    7.1M learners

  • Introduction to Java

    4.7M learners

  • Introduction to C

    1.5M learners

  • Introduction to HTML

    7.5M learners

See all courses
Hot today
ŠžŃˆŠøŠ±ŠŗŠ° в приложении Sololearn
1 Votes
Is anyone else experiencing this Sololearn issue?
0 Votes
NEO V2.0
1 Votes
Best language?
0 Votes
solo learn program issue - iPhone?
1 Votes
How do I keep myself motivated in coding
0 Votes
Is it possible to write Rust code that is as compact and expressive as Python?
0 Votes
Learn - multiple choice course questions display in one box making it impossible to continue
1 Votes
Sql practice
0 Votes
I want to know how to make an Payment App like what I need to learn I need some guidance
0 Votes