Posts

Showing posts with the label python string

Test your knowlege about string

Python String Quiz Python String Quiz (15 MCQs) 1. Which of the following is a valid string in Python? "Hello World" Hello World 'Hello World" 2. What is the output of len("Python") ? 5 6 7 3. What will "Hi" * 3 return? Hi3 HiHiHi Error 4. Strings in Python are: Mutable Immutable None 5. What will "Python".lower() output? python PYTHON Python 6. Which operator is used for concatenation? + * & 7. What does "Hello".find("e") return? 0 1 2 8. Which of the following checks if substring exists? if "sub" exist "string" "sub" in "string" "string" in "sub" 9. What will "Python Programming".split() return? ['Python', 'Programming'] ['Python Programming'] ['P','y...

Topic 11: String Data Type in Python?

Image
👈 Previous Topic                                                                                    String Quiz  Next 👉    String Data Type                                                                     (Reading time   7-10minutes) In Python, a string is a sequence of characters enclosed within single quotes (‘ ’), double quotes (“ ”), or even triple quotes (‘’’ ’’’ or “”” “””). Strings are one of the most commonly used data types because they help store and manipulate textual information  such as names, messages, or file paths. Example: ...