Answers for "int value in python"

1

how to convert int in python

score = 89
score = str(score)
Posted by: Guest on March-03-2020
0

what is an integer in python

# Integers are one of the basic data types in Python
# Simply, integer is a whole number denotes by - int - in Python
# Converting to an integer can be done with - int()
# You can do simple arithmetic with integers
# The default is in decimal - base 10 - but if you want you can view them in different bases
# The biggest integer you can go for is limited by the memory limit of your computer

a = 123
type(a)
#Output - <class 'int'>

b = "456"
c = int(b)
type(c)
#Output - <class 'int'>
Posted by: Guest on January-07-2022

Python Answers by Framework

Browse Popular Code Answers by Language