0
What are strings
what are they use for and examples plz
3 odpowiedzi
+ 3
a string is a series of characters. They are usually used to store messages, words, etc.
Example: my_string = 'programing'
+ 1
String is a variable type.
name="Justin"
country="USA"
question="What is a String"
a tip.. If you use input to recieve a number and then use it for an if check, for example
number=input("Pick a number")
number will be a string..
if number == 1: .... It will read false because it is checking a string as an integer
if number == "1": .... It will as true because it is checking a string as a string
Alternatively, after getting your number you can convert it to an integer
number=input("Pick A number")
number=int(number)
+ 1
String is simply text it is considered also a character array ex: "hello world" is a string that consists of 12 characters that include space and null character at the end '\0'