提交 3dfb28e6 编写于 作者: F feilong

update exercise

上级 2d20396b
{
"exercise_id": 33,
"source": "helloworld.py",
"author": "幻灰龙",
"source": "helloworld.md",
"depends": [],
"multiline": [
{
"str1 = \"Hello,\"": "",
"str2 = \"World!\"": "str = \"Hello,World!\"",
"print('str1'+'str2')": "print(str)"
},
{
"str1 = \"Hello,\"": "",
"str2 = \"World!\"": "",
"print('str1'+'str2')": "print(\"Hello\" +\",\" +\"World!\")"
},
{
"print('str1'+'str2')": "print(str1+str2)"
}
],
"type": "code_options"
}
\ No newline at end of file
# Hello World
输出 "Hello,World!" 字符串,请找出以下选项中<span style="color:red">错误</style>的选项。
## template
```python
if __name__ == '__main__':
str1 = "Hello,"
str2 = "World!"
print(str1+str2)
```
## 答案
```python
if __name__ == '__main__':
str1 = "Hello,"
str2 = "World!"
print('str1'+'str2')
```
## 选项
### 单字符串变量
```python
if __name__ == '__main__':
str = "Hello,World!"
print(str)
```
### 字符串字面量拼接
```python
if __name__ == '__main__':
print("Hello,"+"World!")
```
### 字符串变量拼接
```python
if __name__ == '__main__':
str1 = "Hello,"
str2 = "World!"
print(str1+str2)
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册