python 我想知道这句的具体含义:this only works with two literals,not with arbitrary string express
什么是arbitrary string expression,什么事literals,有什么区别
Two string literals next to each other are automatically concatenated; the first
line above could also have been written word='Help''A'; this only works with two literals,not with
arbitrary string expressions:
人气:466 ℃ 时间:2020-05-25 16:30:24
解答
Python Tutorial?
这里的意思是,两个邻接的字符串会被自动拼接在一起.但这一规则不能对任意的字符串表达式起作用.
>>> "help" "a"
'helpa'
>>> "help" "abdfgdsaf".strip()
'helpabdfgdsaf'
>>> "string".strip() "help"
SyntaxError: invalid syntax
推荐
猜你喜欢
- 巧算2 011×20 122 012-20 112 011×2 012
- To break a record is hard改为同义句
- 化学式为C2H7NO2的汉语名称叫什么?
- 小明从家到学校的路程有5分之3米,一天他到学校后,发现忘带数学书,于是回家去取,小明这天去上学走了多少
- 茂林松柏正兴旺,风霜雪雨总莫摧,异日忽然成大用.功名成就栋梁材
- 三分之一x-1=3x+三分之一
- 一条水渠,它修4天,每天修35米,已修比剩下的少全长的30%,这条水渠全长多少米?
- 英语翻译