Frage im Vorstellungsgespräch bei Microsoft

How to create excel header string

Antworten zu Vorstellungsgespräch

Anonym

18. Apr. 2012

No, in Excel header, header start from A and then increasing to Z. After Z it should come AA to AZ. So the question is write algorithm which generate string like, A B C ....Z AA AB....AZ BA....BZ

1

Anonym

4. Feb. 2013

alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"] string = "" mu = -1 pho = 0 flag = 0 while(string != "ZZ"): if(not flag): string = alphabet[pho] else: string = alphabet[mu] + alphabet[pho] pho += 1 if pho >= len(alphabet): pho = 0 mu += 1 flag = 1 print string

Anonym

18. Apr. 2012

In Office 2010, open Excel, click on "Insert" in the ribbon, and choose "Header &Footer". Is that kind of what they wanted?