[Tutor] I need help

edna rey gisselle312 at hotmail.com
Mon Jul 5 20:32:11 EDT 2021


Nicolás left and now Paola has been left alone watching the performance star award show. She has decided to start recording the first letter of the names of the actors and actresses who appear in the show and to count the number of times in a row a letter appears.

Entry

A list with each of the initial letters of the actor's or actress's name, separated by a space, in the same order of appearance in the show.

Exit

A row with the initial letters of the names of the actors or actresses that appear in the show in their order of arrival, separated by a space, and another row with the number of actors or actresses of the same font that arrived consecutively

Example

Entry

Exit

Y Y Y X X P P P L Q V V E E E E V V R K K K

Y X P L Q V E V R K

3 2 3 1 1 2 4 2 1 3

G G U U U U A A A Z Z Z T T T V V Q Q A A A

G U A Z T V Q A

2 4 3 3 3 2 2 3

E O O E E O O O R R R V J Z Z Z B

E O E O R V J Z B

1 2 2 3 3 1 1 3 1



letras= input(str ("IngreselasInicialesDelosActores")).upper()
frecuencia = []

for n in (len(letras)):
    if n in frecuencia:
        frecuencia[n] +=1
    else:
        frecuencia[n] = 1
print(frecuencia)


IngreselasInicialesDelosActoresG G U U U U A A A Z Z Z T T T V V Q Q A A A
G G U U U U A A A Z Z Z T T T V V Q Q A A A
43
{'G': 2, ' ': 21, 'U': 4, 'A': 6, 'Z': 3, 'T': 3, 'V': 2, 'Q': 2}











More information about the Tutor mailing list