str()

Convetring object to string.
str(object,encode='utf-8',errors='strict')
object : ( Required ) The object which is to be coverted to string
encode : ( Optional ) default is 'utf-8'
errors : ( Optional ) what to do if error occurs.
print(str(3.4)) #  3.4
Using type
print(type(str(3.4))) #  <class 'str'>
Using bytes
my_str = "plus2net.com"
# encoding 'utf-8'
my_bytes = bytes(my_str, 'utf-8')
print(my_bytes) #  b'plus2net.com'
print(type(my_bytes)) #  <class 'bytes'>
print(str(my_bytes, encoding='ascii', errors='ignore'))# plus2net.com




plus2net.com



Post your comments , suggestion , error , requirements etc here




We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2019 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer