Computer Science, asked by TheIMMORTAL5724, 11 months ago

What is string in Python and how can we access values in list.

Answers

Answered by staeen
0

Answer:

We can also use count() function to get the number of occurrences of a string in the list. If its output is 0, then it means that string is not present in the list. l1 = ['A', 'B', 'C', 'D', 'A', 'A', 'C'] s = 'A' count = l1. count(s) if count > 0: print(f'{s} is present in the list for {count} times.

Mark me as BRAINLIEST

Answered by laraibmukhtar55
0

Strings in python:

• In Python, Strings are arrays of bytes signifying Unicode characters. However, Python does not have a character data form, a single character is merely a string with a length of 1.  

• Square brackets can be used to access the values of the string.

• We can access values in a string list by using square brackets

Hope it helped..

Similar questions