Answer to Question #306247 in Python for anon

Question #306247

Write a Python program that takes a String as input from the user, removes the characters at even index and prints the resulting String in uppercase without using the built-in function upper().


Sample Input 1:

String

Sample Output 1:

TIG


1
Expert's answer
2022-03-05T04:11:39-0500
src = input()
res = ''

i = 0
shft = ord('a') - ord('A')
for ch in src:
    if i%2 == 1:
        ch_up = chr(ord(ch) - shft)
        res += ch_up
    i += 1

print(res)

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