+ 2

why string have two definition?

A string is composed of numbers, characters, or symbols. second A string is an ordered sequence of characters.

31st Jul 2019, 5:19 PM
shubham kumar gupta
shubham kumar gupta - avatar
2 Answers
+ 1
Yes its both definitions combined.. A String is an ordered sequence of characters that can consist of letters, numbers and symbols.
31st Jul 2019, 5:28 PM
D_Stark
D_Stark - avatar
0
you can read it like this definition == a string is an ordered sequence of characters. sidenote == these characters can be any letter, symbol or number. the important thing to take away here is is that a string isn’t just letters. it is a set of characters that can be anything, so also numbers or the + sign. but when you use these characters as a string they don’t “mean” anything to the programme. eg print(“1+1”) #between “” is a string #output: 1+1 print(1+1) #this is not a string just numbers used by the programme #output: 2
31st Jul 2019, 5:26 PM
Brave Tea
Brave Tea - avatar