|
发表于 2022-4-11 20:42:48
From FishC Mobile
|
显示全部楼层
|阅读模式
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
大神们帮帮忙我sololearn的一个 python题目,求帮忙,要求是英文的,要求如下:
You are a secret agent, and you receive an encrypted message that needs to be decoded. The code that is being used flips the message backwards and inserts non-alphabetic characters in the message to make it hard to decipher.
Task:
Create a program that will take the encoded message, flip it around, remove any characters that are not a letter or a space, and output the hidden message.
Input Format:
A string of characters that represent the encoded message.
Output Format:
A string of character that represent the intended secret message.
Sample Input:
d89%l++5r19o7W *o=l645le9H
Sample Output:
Hello World
- s = "d89%l++5r19o7W *o=l645le9H"
- result = ""
- for i in s[::-1]:
- if "a" <= i <= "z" or "A" <= i <= "Z" or i == " ":
- result += i
- print(result)
复制代码
|
|