Q11. What is used to create unicode strings in Python?
In Python 3, **all strings are Unicode by default** (type `str`). To create a byte string, prefix the literal with `b`: ```python text = 'HireXTech' # Unicode str raw_byt...
Technical Question Bank · Peer-Reviewed
Search and filter frequently asked interview questions across technical, programming, and behavioral domains. Tailor your interview preparation by difficulty for freshers or experienced developers (25 available).
In Python 3, **all strings are Unicode by default** (type `str`). To create a byte string, prefix the literal with `b`: ```python text = 'HireXTech' # Unicode str raw_byt...
A **docstring** (documentation string) is a string literal that occurs as the very first statement in a module, class, function, or method definition: ```python def calcu...
In Python, the capitalize() method capitalizes the first letter of a string. If the string already consists of a capital letter at the beginning, then, it return s the or...
In Python, convert a string to lowercase using the **`str.lower()`** method: ```python text = "HireXTech INTERVIEW Guide" print(text.lower()) # Output: "hirextech intervi...
Docstrings are not actually comments, but, they are documentation strings. These docstrings are within triple quotes. They are not assigned to any variable and therefore,...
A string in Python is a sequence of alpha-numeric characters. They are immutable objects. It means that they don't allow modification once they get assigned a value. Pyth...
For converting a number into a string, you can use the built-in function str(). If you want an octal or hexadecimal representation, use the inbuilt function oct() or hex(...
We use the lower() method for this. ```python >>> 'AyuShi'.lower() ``` 'ayushi' To convert it into uppercase, then, we use upper(). ```python >>> 'AyuShi'.upper() ``` 'AY...
Use the `.isalnum()` method on a string. It returns `True` if all characters in the string are alphanumeric (letters or numbers) and there is at least one character: ```p...
For this, we'll simply use the max function. ```python >>> max('flyiNg') ``` 'y' The following are the ASCII values for all the letters of this string- f- 102 l- 108 y- 1...
HireXTech uses essential storage to remember your study preferences and third-party advertising cookies via Google AdSense in compliance with GDPR. You can choose to enable essential cookies only or accept all cookies. Read our Privacy Policy.