Special alphabetical order Infosys springboard coding question with solution Problem Statement : Given a non-empty string instr containing only alphabets, print the string outstr by arranging the alphabets of instr in the following order:AaBb……YyZz i.e. all occurrences of ‘A’ in instr will come first, followed by all occurrences of ‘a’, then all occurrences of ‘B’ and so on. Input format:Read the string instr from the standard input stream.Output format:Print outstr to the standard output stream. Question : Code Solution : instr =input() outstr = '' for i in 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz': for j in instr: if i == j: outstr+=i print(outstr) Categories: Coding QuestionSpringboard Tags: #python #springboard 0 Comments Leave a Reply Cancel replyYour email address will not be published. Required fields are marked * Name Email Website What's on your mind? Save my name, email, and website in this browser for the next time I comment. Δ
0 Comments