对比学习Python与C
str1 = 'hello python 2'
# 字符串
i = 3.1415926535 print(str1)
print("hello python\n")
# print 自带换行符
print('%s'%str1)
print(str1)
print("你好,%s OK %d" % (str1, i))
##格式化打印到标准输出 print("%.2f\t%.4f" % (i, i))
 
输出:

hello python 2
hello python

hello python 2
hello python 2
你好,hello python 2 OK 3
3.14    3.1416

Python Date 1–Hello world print的更多相关文章

  1. Python date,datetime,time等相关操作总结

    date,datetime,time等相关操作总结   by:授客 QQ:1033553122 测试环境: Python版本:Python 3.3.2 代码实践: __author__ = '授客' ...

  2. Python 3.x下消除print()自动换行

    Python 2.x下的print语句在输出字符串之后会默认换行,如果不希望换行,只要在语句最后加一个“,”即可.但是在Python 3.x下,print()变成内置函数,加“,”的老方法就行不通了. ...

  3. 【Python】【BugList12】python自带IDLE执行print(req.text)报错:UnicodeEncodeError: 'UCS-2' codec can't encode characters in position 93204-93204

    [代码] # -*- coding:UTF-8 -*- import requests if __name__ == '__main__': target = 'https://unsplash.co ...

  4. python date time

    //test.py import time ticks = time.time()print tickslocaltime = time.localtime(time.time())print loc ...

  5. python logging模块,升级print调试到logging。

    简介: 我们在写python程序的时候,很多时候都有bug,都是自己写的,自己造的孽,又的时候报错又是一堆,不知道是那部分出错了. 我这初学者水平,就是打print,看哪部分执行了,哪部分没执行,由此 ...

  6. Python 2.7 中使用 Print 方法

    print ("test",file=name)类似的方法在python 2中需要先引入 __future__才可使用 import __futhure__ import prin ...

  7. Python输入input、输出print

    1.输入input input是用于输入数据给变量.通过键盘输入的是字符串,如果需要其他格式,需要做转换.比如int.float类型数据,int() 如下是一个例子: 如果a不进行int转换,那么输入 ...

  8. Python:Python2和3不同print汉字方式

    Python3: 可以直接通过print('你好')输出 Python2: 需在开头加#encoding=UTF-8 不过之前输出的时候即使加了开头一行,也是一些混乱的汉字,一看就知道编码错误,后来我 ...

  9. Python内置函数(57)——print

    英文文档: print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False) Print objects to the text str ...

随机推荐

  1. Git 安装与使用

    http://blog.csdn.net/lishuo_os_ds/article/details/8078475#sec-1.8.2 http://blog.csdn.net/showhilllee ...

  2. python真值表

    author:headsen chen  date :2018-06-01  10:53:39 notice:not allowed to copy or you will count law que ...

  3. C# 图片识别技术(支持21种语言,提取图片中的文字)

    图片识别的技术到几天已经很成熟了,只是相关的资料很少,为了方便在此汇总一下(C#实现),方便需要的朋友查阅,也给自己做个记号. 图片识别的用途:很多人用它去破解网站的验证码,用于达到自动刷票或者是批量 ...

  4. 基于Consul+Upsync+Nginx实现动态负载均衡

    基于Consul+Upsync+Nginx实现动态负载均衡 1.Consul环境搭建 下载consul_0.7.5_linux_amd64.zip到/usr/local/src目录 cd /usr/l ...

  5. 在JavaWeb项目中处理静态文件或动态链接拼接网站地址的最优处理方案

    在开发网站时候我们会遇到下面问题? - 在引用网页中引用js和css或者动态的Servlet的时候我们是写绝对路径还是相对路径? - 如果写相对路径吧,上线偶尔会报404,还要手动去拼接绝对路径 - ...

  6. ZOJ 3605 Find the Marble(dp)

    Find the Marble Time Limit: 2 Seconds      Memory Limit: 65536 KB Alice and Bob are playing a game. ...

  7. [VS2015].NET4.0环境下使用.NET2.0程序集,使用sqlite时报异常 出现“混合模式程序集异常”

    在.net 4.0环境下使用sqlite时报异常 混合模式程序集是针对“v2.0.50727”版的运行时生成的,在没有配置其他信息的情况下,无法在 4.0 运行时中加载该程序集其调用的方法是从sqli ...

  8. userAgent font-family

    w view-source:http://you.163.com/ CODE <script type="text/javascript"> (function () ...

  9. 【c++】【常用函数】

    分割字符串:https://www.cnblogs.com/zealousness/p/9971709.html 字符串比较:https://www.cnblogs.com/zealousness/p ...

  10. MFC中使用用户剪贴板

    代码逻辑: 拷贝功能: 1.从编辑控件中获取文本. 2.打开并清空剪贴板.(OpenClipboard,EmptyClipboard) 3.创建一个全局缓冲区.(GlobalAlloc) 4.锁定缓冲 ...