markdown插入python代码块
时间: 2023-09-23 12:02:41 浏览: 205
要在Markdown中插入Python代码块,你可以使用以下的代码块语法:
```python
def somefunc(param1='', param2=0):
'''A docstring'''
if param1 > param2:
# interesting
print('Greater')
return (param2 - param1) or None
class SomeClass:
pass
message = '''interpreter ...
prompt'''
```
以上代码块使用了标准的Markdown代码块语法,并在代码块中展示了一个Python函数、一个类和一个字符串变量的示例。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Markdown常用方法总结](https://download.csdn.net/download/weixin_38725137/13739619)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [PyCharm使用指南(未完成)](https://blog.csdn.net/lingduo24/article/details/78329910)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文