Python学习笔记009
不换行
print("Hello,world!",end='')
print("Hello,world!",end='')
print("Hello,world!",end='')
换行符
linux/python \n
windows \r\n
macOS \r
print() = print(end="\n") 默认换行
制表符 \t
num1 = 0
while num1 <= 5:
print(num1,end="_")
num2 = 0
while num2 <= 7:
print(num2,end="-")
num2 += 1
num1 += 1
print(end="\n")
纵横数列
height = int(input("Height:"))
width = int(input("Width:"))
pic = input("Picture:")
num_height = 1
while num_height <= height:
num_width = 1
while num_width <= width:
print(pic,end="")
num_width += 1
print()
num_height += 1
num2 = 4
while num2 > 0:
num = 4
while num > 0:
print("#",end="")
num -= 1
print()
num2 -= 1
Python学习笔记009的更多相关文章
- Python学习笔记009—函数
1. 空函数 如果想定义一个什么事也不做的空函数,可以用pass语句: def nop(): pass pass语句什么都不做,那有什么用?实际上pass可以用来作为占位符,比如现在还没想好怎么写函数 ...
- python学习笔记整理——字典
python学习笔记整理 数据结构--字典 无序的 {键:值} 对集合 用于查询的方法 len(d) Return the number of items in the dictionary d. 返 ...
- VS2013中Python学习笔记[Django Web的第一个网页]
前言 前面我简单介绍了Python的Hello World.看到有人问我搞搞Python的Web,一时兴起,就来试试看. 第一篇 VS2013中Python学习笔记[环境搭建] 简单介绍Python环 ...
- python学习笔记之module && package
个人总结: import module,module就是文件名,导入那个python文件 import package,package就是一个文件夹,导入的文件夹下有一个__init__.py的文件, ...
- python学习笔记(六)文件夹遍历,异常处理
python学习笔记(六) 文件夹遍历 1.递归遍历 import os allfile = [] def dirList(path): filelist = os.listdir(path) for ...
- python学习笔记--Django入门四 管理站点--二
接上一节 python学习笔记--Django入门四 管理站点 设置字段可选 编辑Book模块在email字段上加上blank=True,指定email字段为可选,代码如下: class Autho ...
- python学习笔记--Django入门0 安装dangjo
经过这几天的折腾,经历了Django的各种报错,翻译的内容虽然不错,但是与实际的版本有差别,会出现各种奇葩的错误.现在终于找到了解决方法:查看英文原版内容:http://djangobook.com/ ...
- python学习笔记(一)元组,序列,字典
python学习笔记(一)元组,序列,字典
- Pythoner | 你像从前一样的Python学习笔记
Pythoner | 你像从前一样的Python学习笔记 Pythoner
随机推荐
- C\C++改变鼠标样式
改变鼠标样式可以使用SetClassLong函数 HCURSOR hcur = LoadCursor(NULL, IDC_CROSS); //加载系统自带鼠标样式 HWND hwnd = GetHWn ...
- js将后台传入得时间格式化
//格式化时间函数Date.prototype.Format = function (fmt) { var o = { "M+": this.getMonth() + 1, //月 ...
- Spring IoC 源码分析 (基于注解) 之 包扫描
在上篇文章Spring IoC 源码分析 (基于注解) 一我们分析到,我们通过AnnotationConfigApplicationContext类传入一个包路径启动Spring之后,会首先初始化包扫 ...
- hybird怎么实现的(核心webview)
链接:https://blog.csdn.net/gongch0604/article/details/80510005
- Go之Cookie和Session
文章引用自 Cookie和Session Cookie和Session是Web开发绕不开的一个环节,本文介绍了Cookie和Session的原理及在Go语言中如何操作Cookie. Cookie Co ...
- Android学习03
ToggleButton和Switch 状态开关ToggleButton与开关switch也是由button按钮派生出来的,因此他们的本质也是按钮,button支持的各种属性,方法toggleButt ...
- 如何在CentOS 7上安装Apache
使用systemctl管理Apache服务 我们可以像任何其他系统单元一样管理Apache服务. 要停止Apache服务,请运行: sudo systemctl stop httpd 要再次启动,请键 ...
- yii2.0 ajax
2.0用的参数是_csrf token = "<?php echo \Yii::$app->request->getCsrfToken()?>", $.aj ...
- 修正SQLSERVER package连接
drop table #temp_mt; --WITH XMLNAMESPACES ('www.microsoft.com/SqlServer/Dts' AS DTS) SELECT ROW_NUMB ...
- agc026F Lotus Leaves
题目链接 题目大意 一个n*m的网格上有一些点,一个点可以跳到与其同一行或同一列的点上.给定起点和终点. 求要使起点不能跳到终点,最少撤走几个点. \(n,m\leq 100\) 解题思路 考虑将能够 ...