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
随机推荐
- TCL Strings
append Append values to variable binary Insert and extract fields from binary strings regexp ...
- December 31st, Week 53rd Tuesday, 2019
Nothing comes from nothing. 天下没有免费的午餐. Nothing comes from nothing, and in some cases, even something ...
- 8.5-Day1T1--Asm.Def 谈笑风生
题目大意 m个操作, 1:添加一个字符串 2:查询字符串s是否被添加过(中至多包含一个通配符“*”) 题解 trie树可以得部分分 用map映射 '*'就枚举26个英文字母来判断就可以了 #inclu ...
- 科技 - 5G
科技 - 5G 一.5G的概念 第五代移动通信技术(英语:5th generation mobile networks或5th generation wireless systems.5th-Gene ...
- 数据库单,多,全库、冷热备份思路及备份与还原(mysqldump)
热备份:服务开启状态下进行备份, 冷备份:服务关闭状态进行备份, 冷备份 数据库原有内容如下: MariaDB [(none)]> show databases;+--------------- ...
- 组件向外暴露v-model绑定的参数
<template> <div class="search-box"> <i class="icon-search">< ...
- About Computer Graphics 2.0
Notes of Computer Graphics 2.0: towards end-user-generated contents CG 1.0 Modeling: construct 3D mo ...
- 「JSOI2013」贪心的导游
「JSOI2013」贪心的导游 传送门 多次询问区间内%一个数的最大值 我们不妨设这个数为M_sea 值域比较小所以考虑分块维护. 我们观察到对于给定的一个 \(p\) ,函数 \(y = x \% ...
- SmartAssembly批处理用法
在SmartAssembly.exe根目录有个SmartAssembly.com . 在命令行执行SmartAssembly.com就能看到所有的命令参数了. 用SmartAssembly.exe建好 ...
- 喵星之旅-狂奔的兔子-redis使用
一.命令行使用 redis大概有200多命令,这里只是入门级别,列举了一些非常常见的内容,如果这些会了就可以开启redis进一步学习了. 1.登录数据库 我们需要知道ip地址.端口号.密码(如果有). ...