You are given a string s, in which one letter occurs twice. every other letter occurs at most once. write a function which given a string s returns a single character string the letter that occurs twice

Respuesta :

The program is an illustration of strings.

Strings are variables that are used to hold texts

The main program

The program written in Python, where comments are used to explain each action is as follows:

#This gets the input

s = input()

#This iterates through the text

for i in range(ord('A'), ord('Z') + 1):

   #This converts each character to lower case

   ch rA = c hr(i) . lo wer()

   #This determines the character with two occurrences

   if s.count(chrA) == 2:

       #This prints the character

       print(chrA)

Read more about strings at:

https://brainly.com/question/15683939

#SPJ1