input

python语言基础笔记

扶醉桌前 提交于 2020-03-05 07:52:47
二进制数据则由bytes类型表示 python没有二进制类型,但可以存储二进制类型的数据,就是用string字符串类型来存储二进制数据,这也没关系,因为string是以1个字节为单位的。 b'\xe4\xb8\xad\xe6\x96\x87' \x表示16进制 ______________________________________________________________________________ #coding=gbk var=input("请输入十六进制数:") #16进制转化二进制 b=bin(int(var,16)) print(b[2:]) _____________________________________________________________________________________ print(format(ord('周'),'b')) 中文转化8进制再转二进制; string:UNICODE unicode类型名词叫:string unicode是文本显示用,根据不同的软件可以encoding不同的软件显示编码。 bytes: bytes bytes类型名词叫:bytes python3编码最大的改变: 把字节串与字符串彻底分开!bytes为存储字节码编码方式 (中文显示unicode,encode--utf8-

html常用标签

巧了我就是萌 提交于 2020-03-05 06:21:46
1 html标题    <h1> to <h6> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <h1>h1</h1> <h2>h2</h2> <h3>h3</h3> <h4>h4</h4> <h5>h5</h5> <h6>h6</h6> </body> </html> h1到h6演示代码 2 html水平线 <hr/> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <h6>h6</h6> <hr/> </body> </html> 水平线演示代码 3 html注释<!-- comment --> 注释并不会显示在网页上 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <h6>h6</h6><!-- hello world --> <hr/> </body> </html> 注释演示代码 4 html段落<p>以及段落换行<br/> <

Python学习之旅_02day

点点圈 提交于 2020-03-05 03:56:27
一.回顾01day学习的东西 1.变量定义:1.1为了存储程序运算过程中的一些中间结果,为了方便日后调用 1.2存在一定的描述性,让大众一看就知道该变量的用途 2.变量的命名规则: 2.1 具有描述性 2.2 变量只能由字母,数字和下划线组成 2.3 不能以关键字(保留字)命名 2.4 驼峰式命名和下划线分割单词 2.5 变量名区分大小写 2.6 不能以中文为变量名 2.7 不能以数字开头 3.缩进 表示是一坨代码,利用相同的缩进表示 4. if a=1 b=2 if a > b:   print("yes") elif a == b:   print("boom") else: print("no") 5.注释 单行注释:# 多行注释:"""***""" 或 '''***''' 6.字符串的拼接 abc qwe print('abc'+'qwe') abcqwe 7.算术运算符 若区分不了优先级,可使用小括号去运算"()";python不允许使用中括号'[]'区分算术等级 1 >>> 1+2 2 3 *加 3 >>> 2*2 4 4 *程 5 >>> 3-2 6 1 *减 7 >>> 4/2 8 2.0 *除 9 >>> 5//2 10 2 *整除 11 >>> 5/2 12 2.5 *除 13 >>> 9%2 14 1 *取余 15 >>> 2**10 16 1024 *幂运算

dom事件

。_饼干妹妹 提交于 2020-03-05 00:59:25
一:注册事件(绑定事件) 注册事件有两种方式: a.传统方式 b.方法监听注册方式 二:优缺点 a.传统注册: 利用on开头的事件 eg: onclick,onmouseove… <button onclick="alert('hi~')" ></button> btn.onclick = function() {} 特点:注册事件的 唯一性 同一个元素同一个事件只能设置一个处理函数,最后注册的处理函数将会覆盖前面注册的处理函数 b.方法监听注册: w3c 标准 推荐方式 addEventListener() 是一个方法 IE9之前的IE不支持此方法,可使用attachEvent()代替 特点:同一个元素同一个事件 可注册多个事件(监听器) 按注册顺序依次执行 三:addEventListener()监听方式 (具有兼容性问题,IE9以上支持) 1.eventTarget.addEventListener(type, listener[, useCapture]) 2.此方法将指定的监听器注册到eventTarget(目标对象)上,当该对象触发指定的事件时,就会执行事件处理函数 type: 事件类型 字符串 ,如 click,mousedown(这里 不需要带on ) listener:事件处理函数,事件发生时,会调用该监听函数 < ! DOCTYPE html > < html

Codeforces Round #283 (Div. 2) A ,B ,C 暴力,暴力,暴力

拈花ヽ惹草 提交于 2020-03-05 00:44:54
A. Minimum Difficulty time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mike is trying rock climbing but he is awful at it. There are n holds on the wall, i -th hold is at height a i off the ground. Besides, let the sequence a i increase, that is, a i  <  a i  + 1 for all i from 1 to n  - 1; we will call such sequence a track. Mike thinks that the track a 1, ..., a n has difficulty . In other words, difficulty equals the maximum distance between two holds that are adjacent in height. Today Mike decided to cover the track with holds

code

浪子不回头ぞ 提交于 2020-03-04 23:53:29
des: #include <stdio.h> #include <string.h> #include <iostream> #include <stdlib.h> using namespace std; int IP_Table[64] = { //IP置换矩阵 58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4, 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8, 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3, 61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7}; int E_Table[48] = { //扩展矩阵 32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9, 8, 9, 10, 11, 12, 13, 12, 13, 14, 15, 16, 17, 16, 17, 18, 19, 20, 21, 20, 21, 22, 23, 24, 25, 24, 25, 26, 27, 28, 29, 28, 29, 30, 31, 32, 1}; int P_Table

C#NET获取CalculateMD5Hash32位

谁都会走 提交于 2020-03-04 23:04:13
1 public string CalculateMD5Hash(string input) 2 { 3 MD5 md5 = MD5.Create(); 4 byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes(input); 5 byte[] hash = md5.ComputeHash(inputBytes); 6 StringBuilder sb = new StringBuilder(); 7 for (int i = 0; i < hash.Length; i++) { sb.Append(hash[i].ToString("X2")); } 8 return sb.ToString(); 9 } 来源: https://www.cnblogs.com/wz2988/p/12416513.html

Django基础

ぃ、小莉子 提交于 2020-03-04 13:39:15
Python的WEB框架有Django、Tornado、Flask 等多种,Django相较与其他WEB框架其优势为:大而全,框架本身集成了ORM、模型绑定、模板引擎、缓存、Session等诸多功能。 基本配置 1、创建Django程序 终端命令:django-admin startproject sitename IDE创建Django程序时,本质上都是自动执行上述命令 上述的sitename是自己定义的项目名称! 其他常用命令:   python manage.py runserver 0.0.0.0:port   python manage.py startapp appname   python manage.py syncdb #django 1.7.1以下   python manage.py makemigrations   python manage.py migrate   python manage.py createsuperuser 2、程序目录 settings.py 放配置文件 urls.py 存放路由系统(映射) wsgi.py 让你做配置:wsgi有多重一种uwsgi和wsgi,你用那种wsgi来运行Django,一般不用改只有你用到的时候在改 manage.py 就是Django的启动管理程序 以上配置文件

Django基础

我的未来我决定 提交于 2020-03-04 13:38:16
Python的WEB框架有Django、Tornado、Flask 等多种,Django相较与其他WEB框架其优势为:大而全,框架本身集成了ORM、模型绑定、模板引擎、缓存、Session等诸多功能。 基本配置 1、创建Django程序 终端命令:django-admin startproject sitename IDE创建Django程序时,本质上都是自动执行上述命令 上述的sitename是自己定义的项目名称! 其他常用命令:   python manage.py runserver 0.0.0.0:port   python manage.py startapp appname   python manage.py syncdb   python manage.py makemigrations   python manage.py migrate   python manage.py createsuperuser 2、程序目录 settings.py 放配置文件 urls.py 存放路由系统(映射) wsgi.py 让你做配置:wsgi有多重一种uwsgi和wsgi,你用那种wsgi来运行Django,一般不用改只有你用到的时候在改 manage.py 就是Django的启动管理程序 以上配置文件,如果是初学者当创建完project后都不要修改

django基础篇

爱⌒轻易说出口 提交于 2020-03-04 13:37:22
Python的WEB框架有Django、Tornado、Flask 等多种,Django相较与其他WEB框架其优势为:大而全,框架本身集成了ORM、模型绑定、模板引擎、缓存、Session等诸多功能。 基本配置 1、创建Django程序 终端命令:django-admin startproject sitename IDE创建Django程序时,本质上都是自动执行上述命令 上述的sitename是自己定义的项目名称! 其他常用命令:  python manage.py runserver 0.0.0.0:port   python manage.py startapp appname   python manage.py syncdb   python manage.py makemigrations   python manage.py migrate   python manage.py createsuperuser 2、程序目录 settings.py 放配置文件 urls.py 存放路由系统(映射) wsgi.py 让你做配置:wsgi有多重一种uwsgi和wsgi,你用那种wsgi来运行Django,一般不用改只有你用到的时候在改 manage.py 就是Django的启动管理程序 以上配置文件,如果是初学者当创建完project后都不要修改