Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

repr() in python

#The repr() function returns a printable representation of the given object.
#repr() takes a single object.
#Syntax
val = "string"
print(repr(val)) #output ---->"'string'"
Comment

python repr()

numbers = [1, 2, 3, 4, 5]

# create a printable representation of the list
printable_numbers = repr(numbers)

print(printable_numbers)

# Output: [1, 2, 3, 4, 5]
Comment

what is repr function in python

#The repr() function returns a printable representation of the given object.
Upvote = "Do make an upvote click on the top right corner button."
>>> print(Upvote)
>>> 'Do make an upvote click on the top right corner button.'

>>> print(repr(Upvote))
>>>"'Do make an upvote click on the top right corner button.'"
Comment

PREVIOUS NEXT
Code Example
Python :: python dictionary accessing an element 
Python :: positive and negative number in python 
Python :: pip path windows 10 
Python :: how to debug python code in visual studio code 
Python :: #math function in python: 
Python :: python own function and map function 
Python :: self python 
Python :: generator comprehension python 
Python :: df.rename(index=str, columns={"A": "a", "C": "c"}) what does index=str means 
Python :: pygame draw square 
Python :: beautifulsoup docs 
Python :: how to remove trailing zeros in python 
Python :: eval() function in python 
Python :: python beautifulsoup get attibute 
Python :: thresholding with OpenCV 
Python :: how to make a calcukatir 
Python :: selenium python get image from url 
Python :: calculate iqr in python dataset example 
Python :: k means clustering python medium 
Python :: csv reader url 
Python :: pyhton mcq 
Python :: python find image on screen 
Python :: Discord.py - change the default help command 
Python :: python pandas change column order 
Python :: pandas mask multiple condition 
Python :: Display vowels in a string using for loop 
Python :: how to get github repository access in python code directly 
Python :: loading .dat file in python 
Python :: how to use group by in python to get 15 mins candle data from 1 min candle 
Python :: rabin karp algorithm 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =