博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
一些基础语法
阅读量:4542 次
发布时间:2019-06-08

本文共 451 字,大约阅读时间需要 1 分钟。

1.使用 \ 将一行语句分为多行显示

statement = "hello world " + \

      "this is my first time of creating blog in cnblogs " + \

      "I am very excited"

print(statement)

output : "hello world this is my first time of creating blog in cnblogs I am very excited"

 

2.语句中包含[],{},()的不要用多行连接符\

days = ['Monday','Tuesday',

   'Wednesday','Thursday','Friday']

 

3.三引号可以用来编写多行句子

statement = """我是第一行

我是第二行"""

输出的结果是两行

 

转载于:https://www.cnblogs.com/springbrotherhpu/p/8228192.html

你可能感兴趣的文章
php笔记一
查看>>
nginx 配置
查看>>
SpringBoot使用JPA来做数据查询
查看>>
linux下如何修改mysql默认配置文件的位置
查看>>
判断二叉树之间的子树关系
查看>>
HDU 1233 还是畅通工程(Kruskal)
查看>>
MySQL where
查看>>
正则表达式对象&&String对象
查看>>
MYSQL的连接查询
查看>>
java中的static关键字
查看>>
使用java操作HDFS(一)
查看>>
Dynamics CRM2011 通过DeveloperToolkit在VS中部署遇到的问题
查看>>
hadoop上的C++程序开发
查看>>
虚拟机桥接模式不能上网
查看>>
Spring MVC之@RequestParam @RequestBody @RequestHeader 等详解
查看>>
linux下vi命令大全
查看>>
Android使用UncaughtExceptionHandler捕获全局异常
查看>>
Codeforces Round #262 (Div. 2)
查看>>
第五章 引用类型> Data类型
查看>>
HBase学习笔记
查看>>