Conversion of string to upper case without inbuilt methods

前端 未结 7 1686
轻奢々
轻奢々 2021-01-29 08:28

I am trying to perform conversion from a lowercase to uppercase on a string without using any inbuilt functions (other than ord() and char()). Following the logic presented on a

7条回答
  •  遥遥无期
    2021-01-29 08:39

    char=input("Enter lowercase word :")
    for letter in char:
        s=ord(letter)
        if s>=97 and s<=122:
            print(chr(s-32),end=" ")
    

提交回复
热议问题