#1 print函数(python版本3.3.5):

>>> help(print)
Help on built-in function print in module builtins:

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('hello world')
  hello world

#2 字符串:

  >>> print('i love i')
  i love i

  >>> print('i love '+'i')  #连接两个字符串
  i love i

  >>> print('i love '*8)  #重复打印字符串
  i love i love i love i love i love i love i love i love

  >>> print('i love\n'*8)  #\n 换行符
  i love
  i love
  i love
  i love
  i love
  i love
  i love
  i love

#3 数值(整型):

  >>> print(5+3)
  8

  >>> 5+3
  8

  >>> 98765432123456789*98765432123456789
  9754610582533150213077274750190521

Python-2 print的更多相关文章

  1. python中print后面加逗号

    python中print输出一行,如果想多次输出的内容不换行,可以在print后面加逗号 例如 每个输出一行 phrase = "abcdefg" # Add your for l ...

  2. python中print()函数的“,”与java中System.out.print()函数中的“+”

    python中的print()函数和java中的System.out.print()函数都有着打印字符串的功能. python中: print("hello,world!") 输出 ...

  3. Python之print()函数

    1. 输出字符串 >>> str = 'Hello World' >>> print (str) Hello World 2. 格式化输出整数 支持参数格式化 &g ...

  4. Python中print字体颜色的设置

    Python中print字体颜色的设置 实现过程:       终端的字符颜色是用转义序列控制的,是文本模式下的系统显示功能,和具体的语言无关.       转义序列是以ESC开头,即用\033来完成 ...

  5. 【313】python 中 print 函数用法总结

    参考:python 中 print 函数用法总结 参考:Python print() 函数(菜鸟教程) 参考:Python 3 print 函数用法总结 目录: 字符串和数值类型 变量 格式化输出 p ...

  6. Python之print详解

    Python之print详解 http://www.jb51.net/article/55768.htm   print的一些基本用法,在前面的讲述中也涉及一些,本讲是在复习的基础上,尽量再多点内容. ...

  7. Python中print()函数不换行的方法

    一.让print()函数不换行 在Python中,print()函数默认是换行的.但是,在很多情况下,我们需要不换行的输出(比如在算法竞赛中).那么,在Python中如何做到这一点呢? 其实很简单.只 ...

  8. Python 3 print 函数用法总结

    Python 3 print 函数用法总结 1. 输出字符串和数字 print("runoob")    # 输出字符串 runoob print(100)            ...

  9. Python中print用法里面% ,"%s 和 % d" 代表的意思

    Python 编程 里面% . "%s 和 % d" 代表的意思 %s,表示格化式一个对象为字符 %d,整数 "Hello, %s"%"zhang3& ...

  10. 对Python中print函数参数的认识

    输出函数是最常用的,对print()参数的准确认识尤为重要. sep='':sep参数表示函数中不同value的分隔符,默认为一个空格. end='':end参数表示函数结尾的处理,默认换行. 例如: ...

随机推荐

  1. 《C标准库》——之<string.h>

    <string.h>里的字符串操作函数是经常要用到的,因此阅读了源码后自己实现了一些: 拷贝函数 void * Mymemcpy(void * sDst, const void * sSr ...

  2. CentOS7 搭建python3 Django环境

    yum install gcc yum install make yum install openssl-devel -y yum install sqlite-devel -y wget https ...

  3. Ubuntu下安装boost

    今天开始安装配置Ubuntu开发环境(Ubuntu 12.04).在干活之前就预计到会遇到很多问题,但是没想到一开始就卡壳,可能是linux中各种包的依赖关系太复杂了,决定写个帖子记录一下,免得以后再 ...

  4. Python之路,day10-Python基础

    一.进程进程:一个程序要运行时所需的所有资源的集合 进程是资源的集合,相当于一个车间 一个进程至少需要一个线程,这个线程为主线程 一个进程里可以有多个线程 cpu cores越多,代表着你可以真正并发 ...

  5. Python>>>创建一个简单的3D场景

    首先安装PyOpengl pip install PyOpenGL PyOpenGL_accelerate

  6. Python>>>使用Python和Pygame创建画板

    下面是画板截图 # -*- coding: utf-8 -*- import pygame from pygame.locals import * import math class Brush: d ...

  7. mongoDB之Pipeline Aggregation Stages

    原文链接:https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/ 管道聚合 $project Reshapes ...

  8. 【SharePoint学习笔记】第4章 SharePoint UI 定制

    第4章 SharePoint UI 定制   SharePoint 与 ASP.NET     好的​Asp.Net人员很快就能成为好的SharePoint开发人员     Web应用程序    Mi ...

  9. GDB详解

    1 简介 2 生成调试信息 3 启动GDB 的方法 4 程序运行上下文 4.1 程序运行参数 4.2 工作目录 4.3 程序的输入输出 5 设置断点 5.1 简单断点 5.2 多文件设置断点 5.3 ...

  10. 技术|程序员必须要学会Google搜索技巧

    程序员必须要学会Google搜索技巧 摘要: 因为Google在我天朝被墙,学FQ请通过Bing进行搜索如何FQGoogle搜索技巧我曾经多次劝我的另一个朋友花10分钟学习一下Google通配符的使用 ...