关于js和python的字符串运算

新手上路,请多包涵

js代码:
var a = '123';
console.log(a >> 2); // result : 30

python(3)代码:

a = '123'
print(a >> 2)        #  TypeError: unsupported operand type(s) for >>: 'str' and 'int'

请问一下位各位大佬:

如何把上面这段js翻译成python ? 谢谢!

阅读 1.6k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题