• Q & A – Python String

    Q & A – Python String

    (1) What Is A String Datatype? A String is a collection of a sequence of characters. A String can contain Alphabetic, Numeric, or Special characters. A String variable is enclosed within a single(”) or double quote(“”). A String type in Python is of the ‘str’ type. Example-1 name = ‘Subrat Kumar Sahoo’ print(name) Subrat Kumar Sahoo Example-2 password = "hallo@123" print(password) hallo@123 Example-3 country = ‘India’ print(country) India (2) How To Check Existence Of A Character Or A Sub-string In A String? You can use ‘in’ keyword to check the existence of a sub-string in a string. Example-1 "pass" in

    Read More