python写代码怎么跳到下一行
2023-03-20 15:28:14 时间
Python中一般是一行写完所有代码,如果遇到一行写不完需要换行的情况,有两种方法:
1.在该行代码末尾加上续行符“ ”(即空格+);
test = 'item_one' 'item_two' 'tem_three'
输出结果:
'item_oneitem_twotem_three'
2.加上括号,() {} []中不需要特别加换行符:
test2 = ('csdn ' 'cssdn')
输出结果:
csdn cssdn
if…and:
if (where there is a will and there is a way)
多次未输出结果
test3 =('Hello' ' ' 'world')
输出结果:
Hello world
推荐学习《python教程》
相关文章
- 《Vue.js 设计与实现》读书笔记 - 第 4 章、响应系统的作用与实现
- 使用FormData格式在前后端传递数据
- macOS新版本终于删掉自带Python2,这波操作连Python死忠粉都叫好
- Jemeter控制器实现脚本逻辑
- 计算机语言
- python基础__十大经典排序算法
- python基础_日常高频用法
- python基础__全局变量
- python进阶__struct数据处理详解
- python进阶__用socket封装TCP
- python进阶__常用的进制、字符串、字节之间的转换
- python基础__encode编码+decode解码
- python基础__re正则表达式
- python基础__装饰器(修饰器)
- python必备基础
- python进阶__实现UDP通信
- pytest.main( )参数大全和装饰器
- cmd下执行pytest报错找不到文件模块
- python小技巧
- python中文官方文档记录