python3.5.3rc1学习一
print ("Hello Pythoh3")
print('我喜欢"香蕉"')
print('we\'ar go to shoping.')
print("我们发现这个\"地方\"不一样")
print("Hi" + "Tom")
##print("Hi" + 5)
print("Hi" + str(5))
print(int('8') + 5)
print(float('8.5') + 5)
print(5 + 8)
print(9 - 5)
print(3 * 6)
print(20/3)
print(4**4)
var1 = 5
print(var1)
var2 = 'hello'
print(var2)
var3 = 5 + 67
print(var3)
var4 = print('hello python 3')
print("--------------------")
#打印10以内的整数
contion = 1
while(contion<10):
print (contion)
contion +=1
print("--------------------")
#for打印1到9的数字
i = 1
for i in range(9):
print(i+1)
examplelist = [1,2,3,4,5,6,7,8,9]
for i in examplelist:
print (i)
for i in range(1,10):
print (i)
#1到100数相加
i=1
sum=0
while i<101:
sum+=i
i+=1
print (sum)
#if语句
x = 5
y = 8
z = 4
s = 5
if x < y:
print('x is less than y')
if x < y > z:
print('x is less than y and greater than z')
if x <=s:
print('x is less than or equal to s ')
python3.5.3rc1学习一的更多相关文章
- python3.5.3rc1学习十一:字典与模块
#os模块import oscurDir = os.getcwd()print(curDir) os.mkdir("新建") import timetime.sleep(2)os. ...
- python3.5.3rc1学习十:网络请求
#sys模块import sys sys.stderr.write('This is stderr text\n')# 因为从定向有缓冲区,所以需要以下这行代码sys.stderr.flush()sy ...
- python3.5.3rc1学习九:正则表达式
# 正则表达式 ''''' 正则表达式是有一些特殊字符组成,能够帮你找到一些符合一定规则的字符串 先来了解几个符号所代表的意思 \d 匹配所有的数字 \D 匹配所有,但是数字除外 \s 空格 \S 匹 ...
- python3.5.3rc1学习八:文件打包
from cx_Freeze import setup, Executable setup(name='test to exe', version = '0.1', description='test ...
- python3.5.3rc1学习七:多线程
import threading def exampleFun(): #打印当前激活的线程数量 print(threading.active_count) #查看上面激活的线程是哪几个 print(t ...
- python3.5.3rc1学习六:画图
# 可以设置颜色,g代表green, r代表red,y代表yellow,b代表blue# linewidth = 5,设置线条粗细 # label 设置线条名称 ##plt.plot(x,y,'b', ...
- python3.5.3rc1学习五:模块
#比较大小#name:maxNumber.py#比较两个数大小#C:\Users\Anthony\AppData\Local\Programs\Python\Python36-32\Lib\site- ...
- python3.5.3rc1学习五:列表与元组
#元组和列表 #元组定义x = 5,6,2,6 #or x = (5,6,2,6) #列表定义 y = [5,6,2,6] # 元组的使用,我们用return语句来演示 def exampleFunc ...
- python3.5.3rc1学习四:类
class calculator: def add(x,y): return x + y print(added) def sub(x,y): return x - y print(sub) def ...
- python3.5.3rc1学习三:文件操作
##全局变量与局部变量x = 6 def printFuc(): y = 8 z =9 print(y + z) print(x) printFuc()#print(y)#常见错误##name = & ...
随机推荐
- python模块下载备份
https://pypi.org/ https://pypi.doubanio.com/simple/
- Invoke 与 BeginInvoke的区别
引用文章路径:https://www.cnblogs.com/lsgsanxiao/p/5523282.html invoke和begininvoke 区别 一直对invoke和begininvoke ...
- 如何使用postman判断返回结果是否正确
针对一个接口,我们在知道参数以及参数对应的结果时,可以通过postman进行判断,验证返回数据是否与预期数据相等.这样可以使我们的接口测试更加的方便简洁. 1.准备数据. postman可以接受的文件 ...
- html和css常见问题解答
1. 详细描述层叠和继承的概念. 元素内嵌样式(用元素的全局属性style定义的样式) 文档内嵌样式(定义在style元素中的样式) 外部样式(用link元素导入的样式) 用户样式(用户定义的样式) ...
- AntzOs系列导航
Antz操作系统 一个自制的操作系统,Antz .半图形化半命令式系统,同时嵌入Antzscript脚本语言(写在之后). 自制操作系统Antz(1)——Boot Sector 自制操作系统Antz( ...
- "One or more types required to compile a dynamic expression cannot be found. Are you missing references to Microsoft.CSharp.dll and System.Core.dll?"的解决方法
#事故现场: 在一个.net 4.0 的项目中使用dynamic,示例代码如下: private static void Main(string[] args) { dynamic obj; obj ...
- 从零开始的微信小程序入门教程(一)
之前说要和同事一起开发个微信小程序项目,现在也在界面设计,功能定位等需求上开始实施了.所以在还未正式写项目前,打算在空闲时间学习下小程序.本意是在学习过程中结合实践整理出一个较为入门且不是很厚的教程, ...
- Jenkins的安装后配置
配置Jenkins server 1.安装插件:选择自定义插件安装 Locale plugin Localization: Chinese (Simplified) Git Subversion HT ...
- Java设计模式:Simple Factory(简单工厂)模式
概念定义 简单工厂(Simple Factory)模式,又称静态工厂方法(Static Factory Method)模式,即定义一个工厂类,根据传入的不同参数创建不同的产品实例,这些实例对象具有共同 ...
- gitlab的安装配置与简单使用
安装 gitlab,建议系统内存 6G ,不然会报错. 一.如何安装 gitlab 下载 gitlab 的 RPM 包 https://packages.gitlab.com/gitlab/gitla ...