General • Asked about 5 years ago by Jake from AlgoDaily
This is the main discussion thread generated for What are Strings and String Operations?.
This needs an update, Given a string email the claim is that the statement below prints the count of the given character but it results in an error because count function is unknow
> print(count(email, 'i')) #prints 2
Not sure if the intention was to introduce another count function but count needs to be invoked on the string via variable name as shown below,
> email.count("i") # prints 2
string is a unicode character that store only single variable and if you want to add multiple char then you have to make an array for this.e.g you want to take an input of phrase like write my essay then you have to make an array for this. A string operation includes concatenation, scanning and translations.