Answer to Question #349535 in Python for Raj

Question #349535

Yash has a sequence of 26 distinct integers P = (P₁, P2, ..., P26)

consisting of integers from 1 to 26. He constructs a string

S following the below rule:

• For every i where (1 <=i<= 26), the i-th character of

S is the lowercase English letter at comes P₁-th in

alphabetical order.

Your task is to output the resultant string S


1
Expert's answer
2022-06-09T18:21:54-0400
def yash(P):
    ALPHABET = list('abcdefghijklmnopqrstuvwxyz')
    S = ''
    for i in P:
        S += ALPHABET[i - 1]
    return S

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS