runtime
59 / 500
question 59 Strings & Text · hard

Column number to letters

A report generator knows a value belongs in column 28 and has to write it to spreadsheet column AB. Columns run A–Z (1–26), then AA–AZ (27–52), and so on up to XFD (16384). Turn number into its column letters. There is no zero digit in this system, which is why ordinary base-26 conversion gives wrong answers at the edges: subtract 1 before taking each remainder.

Inputnumber, a whole number from 1 to 16384
Printsthe column letters
Examples28 → AB; 1 → A; 26 → Z
Expected output1 line
  1. 1AB

Loading your progress…

Column number to letters — Python practice · Runtime