编写一个简单的程序,从键盘读取一行,并输出相同的行,每个单词都反转.单词被定义为字母数字字符或连字符(' - ')的连续序列.例如,如果输入是"你能帮助我吗!"输出应该是"naC uoy pleh em!"
我只是尝试使用以下代码,但它有一些问题,
print"Enter the string:"
str1=raw_input()
print (' '.join((str1[::-1]).split(' ')[::-2]))
Run Code Online (Sandbox Code Playgroud)
它打印出"naC uoy pleh!em",只看感叹号(!),这就是问题所在.有谁可以帮我???
我需要从github上的私有存储库中检索所有提交。
我已经尝试使用github API文档。它提供了用于检索公共存储库提交的API。 https://api.github.com/repos/:owner/:repo/commits
有人可以帮助我从私有存储库中获取所有提交吗?
我有两个清单,
[[1, 2], [4, 7], [11, 13], [15, 21]]
[[3, 4], [5,12], [23, 25]]
Run Code Online (Sandbox Code Playgroud)
我想要这样的输出.
[[1, 2], [3,13], [15, 21], [23, 25]]
Run Code Online (Sandbox Code Playgroud)
有人可以帮帮我吗?