Alright in this guide we are going to explore Python strings. how strings work, what functions we have, most used functions and so on
So here is a example for string
// Simple string "any text goes here" or "single word"
To print the value we use
// Print values // print variable value print(variable_name) // Print variable type print(type(variable_name))
// Defining a first_name string and assigning to variable first_name = 'Roger'
first_name = 'Roger' last_name = ' smith' output = first_name + last_name output -> Roger smith
Here we get user input and assign it to variable "first_name".
first_name = input("Please enter your name") print_r(first_name)
lower() // makes string lowercase. upper() // makes string uppercase. capitalize() // capitalize string. islower() // checks is string is lower case returns true or false isupper() // checks is string is upper case returns true or false isalpha() // checks is string is alphabet only returns true or false isdigit() // checks is string is numbers only returns true or false isalnum() // checks is string is has alpha or number returns true if either type is present find() // finds substring in string returns index or -1 index() // finds substring in string returns index or error len() // returns length of string strip() // removes specific values from string.