下面是 print函数的一种用法,用逗号隔开,可在同一行打印不同类型的数据。
x = input('请你输入被除数:')
y = input('请你输入除数:')
z = float(x)/float(y)
print(x,'/',y,'=',z)

#########################################################################################

>>> help(print) #python查看帮助的其中一种方式

print(...)
print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)

Prints the values to a stream, or to sys.stdout by default.
Optional keyword arguments:
file: a file-like object (stream); defaults to the current sys.stdout.
sep: string inserted between values, default a space.
end: string appended after the last value, default a newline.
flush: whether to forcibly flush the stream.

##############################################################################

print打印倒计时

import time

print("倒计时程序")

for x in range(5,-1,-1):

  mystr = "倒计时" + str(x) + "秒"

  print(mystr,end = "")

  print("\b" * (len(mystr)*2),end = "",flush=True) #\b 退格 (len(mystr)打印len(mystr)字符串长度 1个中文字符 = 2个英文字符(占位),所以*2

  time.sleep(1)

Python【print函数】的更多相关文章

  1. Python print() 函数

    Python print() 函数  Python 内置函数 描述 print() 方法用于打印输出,最常见的一个函数. print 在 Python3.x 是一个函数,但在 Python2.x 版本 ...

  2. Python print函数用法,print 格式化输出

    原文地址:http://blog.csdn.net/zanfeng/article/details/52164124 使用print输出各型的 字符串 整数 浮点数 出度及精度控制 strHello ...

  3. [转载]Python print函数用法,print 格式化输出

    使用print输出各型的 字符串 整数 浮点数 出度及精度控制 strHello = 'Hello Python' print strHello #输出结果:Hello Python #直接出字符串 ...

  4. python——print函数

    .print()函数概述 print() 方法用于打印输出,是python中最常见的一个函数. 该函数的语法如下: print(*objects, sep=' ', end='\n', file=sy ...

  5. Python print函数使用

    本文链接:https://www.cnblogs.com/zyuanlbj/p/11905405.html 函数定义 def print(self, *args, sep=' ', end='\n', ...

  6. Python——print函数输出对齐问题

    原创声明:本文系博主原创文章,转载及引用请注明出处. 当我们使用print函数时,若指定输出宽度,例如: >>> import math >>> print('|P ...

  7. 17.Python print()函数高级用法

    前面使用 print() 函数时,都只输出了一个变量,但实际上 print() 函数完全可以同时输出多个变量,而且它具有更多丰富的功能. print() 函数的详细语法格式如下: print (val ...

  8. Python print函数参数详解

    官方文档 print(…)    print(value, …, sep=’ ‘, end=’\n’, file=sys.stdout, flush=False)    Prints the valu ...

  9. Python print函数详解

    1 """ 2 print(...) 3 print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=Fals ...

  10. python print函数

随机推荐

  1. 第二届强网杯部分题writeup

    0x00 题目名称 签到 操作内容:   FLAG值: flag{welcome_to_qwb} 0x01 题目名称 Weclome 操作内容: 通过查看文件发现是一个bmp格式的图片文件,然后加上后 ...

  2. Nginx-HTTP之ngx_http_top_header_filter

    1. ngx_http_top_header_filter 该链表主要是用于构造响应消息的消息报头. ngx_http_top_header_filter 单链表有如下模块插入了操作: ngx_htt ...

  3. jquery中mouseover和mouseenter的区别

    jquery中mouseover和mouseenter的区别 一.总结 一句话总结: 见名知意:enter(进入)和over(在上方)的意思好好思考一下 mouseover就是从子元素回到自己的时候也 ...

  4. ADB命令指令控制Android系统的WIFI连接开启/关闭状态

    Android系统的usb调试已开启,连接电脑(有ADB环境) 1.在cmd中,进入shell指令模式 adb shell 2.进入ROOT指令模式 su 3. 打开WIFI指令 svc wifi e ...

  5. 7.Mahout菩萨

    1.Maout简介 2.机器学习介绍 3.Mahout算法介绍

  6. P2341 [HAOI2006]受欢迎的牛(更完)

    P2341 [HAOI2006]受欢迎的牛 题解 tarjan 缩点板子题 如果 A 稀饭 B,那就 A 向 B 连边,构造出一个有向图 如果这个有向图里有强连通分量,也就说明这个强连通分量里的所有奶 ...

  7. LC 957. Prison Cells After N Days

    There are 8 prison cells in a row, and each cell is either occupied or vacant. Each day, whether the ...

  8. ceph报错

    [ceph_deploy.mon][ERROR ] RuntimeError: config file /etc/ceph/ceph.conf exists with different conten ...

  9. java文件上传系统

    我们平时经常做的是上传文件,上传文件夹与上传文件类似,但也有一些不同之处,这次做了上传文件夹就记录下以备后用. 首先我们需要了解的是上传文件三要素: 1.表单提交方式:post (get方式提交有大小 ...

  10. MATLAB学习(六)绘图图形功能

    >> x=0:.1:2*pi;plot(x,sin(x),x,cos(x))                               >> plot(x,sin(x),'p ...