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 = & ...
随机推荐
- CQRS(Command and Query Responsibility Segregation)与EventSources实例
CQRS The CQRS pattern and event sourcing are not mere simplistic solutions to the problems associate ...
- JUC-1-volatile
什么是volatile关键字 volatile是轻量级同步机制,与synchronized相比,他的开销更小一些,同时安全性也有所降低,在一些特定的场景下使用它可以在完成并发目标的基础上有一 ...
- Codeforces Round #603 (Div. 2) A. Sweet Problem 水题
A. Sweet Problem the first pile contains only red candies and there are r candies in it, the second ...
- python--numpy生成正态分布数据及randint randn normal的使用
正太分布:也叫(高斯分布Gaussian distribution),是一种随机概率分布 机器学习中numpy.random如何生成这样的正态分布数据,本篇博客记录这样的用法 import numpy ...
- 【nginx启动报错】重启服务器之后nginx启动错
错误信息: # ./nginx nginx: [emerg] open() "/var/run/nginx/nginx.pid" failed (2: No such file ...
- [06]ASP.NET Core中的进程内(InProcess)托管
ASP.NET Core 进程内(InProcess)托管 本文作者:梁桐铭- 微软最有价值专家(Microsoft MVP) 文章会随着版本进行更新,关注我获取最新版本 本文出自<从零开始学 ...
- copy-and-swap idiom
This answer is from https://stackoverflow.com/a/3279550/10133369 Overview Why do we need the copy-an ...
- ASP.NET Core基于K8S的微服务电商案例实践--学习笔记
摘要 一个完整的电商项目微服务的实践过程,从选型.业务设计.架构设计到开发过程管理.以及上线运维的完整过程总结与剖析. 讲师介绍 产品需求介绍 纯线上商城 线上线下一体化 跨行业 跨商业模式 从0开始 ...
- 为什么 WPF 的 Main 方法需要标记 STAThread 。
在编写 WPF 程序时,会发现 Main 方法上方会标记 [STAThread] . 作用:STAThread 标记主线程,也就是 UI 线程是 STA 线程模型. 1 什么是 STA ? 与 STA ...
- 通过SSH通道来访问MySQL
许多时候当要使用Mysql时,会遇到如下情况: 1. 信息比较重要,希望通信被加密.2. 一些端口,比如3306端口,被路由器禁用. 对第一个问题的一个比较直接的解决办法就是更改mysql的代码,或 ...