Representing infinity

0 votes
I was going through the pseudocode of an algorithm and there it assigns a variable to infinity. I know this makes some sense mathematically but is there a way to actually assign a variable to infinity in python?
Jun 27, 2018 in Python by nightshade
• 870 points
13 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
import math
infinity = math.inf

Now you can use infinity in your program

answered Jun 27, 2018 by Hamartia's Mask
• 1,580 points

Related Questions In Python

0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 920 points
19 views
+4 votes
6 answers

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.