Author name: DONTHULA BHUVANESHWARI

str() vs repr() function in python

by : D.BHUVANESHWARI str() vs repr() function in python str() : This function is used to represent the string. Python programming language is used to convert the specified value into a string datatype. str() function Syntax: str(object, encoding=’utf-8?, errors=’strict’) object: The object whose string representation is to be returned. encoding : Encoding of the given …

str() vs repr() function in python Read More »

What does the \’b\’ character do in front of a string literal in python

By: BHUVANESHWARI In python , the ‘b’ character before a string is used to specify the string as a “byte string”. By adding  the ‘b’ character before a string literal, it becomes a bytes literal. The string content should be a series of bytes and not character. Bytes literals are utilized  for representing binary data …

What does the \’b\’ character do in front of a string literal in python Read More »

Random string generation with upper case letters and digits in Python

Random modules : It refers to the collection of data that can be available in any order. Random modules is used to generate the random strings. It consisting of numbers, characters and punctuation that contain any pattern which we want. It contain two methods 1.random.choice() , 2.secrets.choice(). when the program has been generated output randomly …

Random string generation with upper case letters and digits in Python Read More »

Scroll to Top