day2 for,not,while,range】的更多相关文章

>>> def str_len(s): ... l = len(s) ... if l > 3: ... print("3") ... elif l < 3: ... print("2") ... elif l == 3: ... print("1") ... else: ... print("0") ... >>> st = input("请输入一个字符串:"…
python s12 day2   入门知识拾遗 http://www.cnblogs.com/wupeiqi/articles/4906230.html 基本数据类型 注:查看对象相关成员 var,type,dir 一.整数 如: 18.73.84 每一个整数都具备如下功能: class int(object): """ int(x=0) -> int or long int(x, base=10) -> int or long Convert a number…
##DAY2 UILabel.UITextField.UIButton.UIImageView.UISlider #pragma mark ———————UILabel——————————— UILabel属性: text:文本内容 textColor:内容的颜色 textAlignment:对齐方式(水平方向) font:字体 numberOfLines:行数 lineBreakMode:断行模式 shadowColor:阴影颜色 shadowOffset:阴影大小(阴影向x正⽅向偏移a,向y…
主要内容: for循环 while循环 格式化输出(2) 数据统计及记录 ############################################################# 1.for循环 (A): # #one_guess_age# num_age = 40# for i in range(3):# age_input = int(input("input age:"))# if num_age == age_input:# print ("OK&q…
python全栈开发-Day2 布尔 流程控制 循环   一.布尔 1.概述 #布尔值,一个True一个False #计算机俗称电脑,即我们编写程序让计算机运行时,应该是让计算机无限接近人脑,或者说人脑能干什么,计算机就应该能干什么,人脑的主要作用是数据运行与逻辑运算,此处的布尔类型就模拟人的逻辑运行,即判断一个条件成立时,用True标识,不成立则用False标识 a=3 b=5 a > b #不成立就是False,即假 #False a < b #成立就是True, 即真 #True #接下…
元组(tuple) 元组其实跟列表差不多,也是存一组数,与列表相比,元组一旦创建,便不能再修改,所以又叫只读列表. 语法: names = ("Wuchunwei","Yangmengmeng","Lvs") #元组只有2个方法,一个是count,一个是index >>> tuple1 = (,,,') >>> print (tuple1[]) >>> print (tuple1[-]) &g…
Problem Description \(Sylvia\) 是一个热爱学习的女孩子. 前段时间,\(Sylvia\) 参加了学校的军训.众所周知,军训的时候需要站方阵. \(Sylvia\) 所在的方阵中有\(n*m\)名学生,方阵的行数为 \(n\),列数为 \(m\). 为了便于管理,教官在训练开始时,按照从前到后,从左到右的顺序给方阵中 的学生从 \(1\) 到 \(n*m\) 编上了号码(参见后面的样例).即:初始时,第 \(i\) 行第 \(j\) 列 的学生的编号是\((i-1)*…
1.day2题目 1.判断下列逻辑语句的True,False. 1)1 > 1 or 3 < 4 or 4 > 5 and 2 > 1 and 9 > 8 or 7 < 6 2)not 2 > 1 and 3 < 4 or 4 > 5 and 2 > 1 and 9 > 8 or 7 < 6 2.求出下列逻辑语句的值. 1),8 or 3 and 4 or 2 and 0 or 9 and 7 2),0 or 2 and 3 and…
Day2:求1000以内的素数 #素数:除了1和它本身外,不能被其他自然数整除 #判断素数的方法:1).暴力法:从2到n-1每个数均整除进行判断   2).开根号法:从2到sqrt(n)均做整除判断(原因:一个合数一定含有小于自己平方根的质因子) 方法1: prime = [] #存储素数 for m in range(2,1001): state = 1 #创建标签来判断状态 for i in range(2,m - 1): if m % i == 0: state = 0 break if…
目录 刷题记录:[CISCN2019 东北赛区 Day2 Web3]Point System 知识点 1.padding-oracle attack 2.cbc字节翻转攻击 3.FFMpeg文件读取漏洞 总结 刷题记录:[CISCN2019 东北赛区 Day2 Web3]Point System 题目复现链接:https://buuoj.cn/challenges 参考链接:CISCN 2019 东北赛区 Day2 Web3 WriteUp Padding Oracle Attack 拖了一个星…
目录 刷题记录:[CISCN2019 总决赛 Day2 Web1]Easyweb 一.涉及知识点 1.敏感文件泄露 2.绕过及sql注入 3.文件上传:短标签绕过php过滤 刷题记录:[CISCN2019 总决赛 Day2 Web1]Easyweb 题目复现链接:https://buuoj.cn/challenges 参考链接:BUUCTF的wp(随时弃坑) 一.涉及知识点 1.敏感文件泄露 访问robots.txt可以得到image.php.bak 2.绕过及sql注入 贴上脚本 import…
目录 刷题记录:[CISCN2019 华北赛区 Day2 Web1]Hack World 一.前言 二.正文 1.解题过程 2.解题方法 刷题记录:[CISCN2019 华北赛区 Day2 Web1]Hack World 一.前言 离国赛已经过去好久了,到现在才看复现,这道题当时做的时候没有什么头绪,现在来看答案发现其实没有很难,就是经验还不足 二.正文 题目复现链接:https://buuoj.cn/challenges 参考链接:ciscn2019华北赛区半决赛day2_web1题解 1.解…
目录 python day2 1. 编码转换 2. python的基本数据类型 3. for 迭代遍历 4. 列表list 5. 元组tuple 6. 字典dict 7. 枚举enumerate 8. range和xrange 9. 作业 python day2 2019/10/5 1. 编码转换 编程是外国佬发明的,所以一开始的编码表只有英文与标点符号,没有中文的事. ASCII编码表:一个字符占用两个字节. 后来中国人发明了GBK编码表,可以显示中文. 再后来又有了Unicode万国码. U…
id=0 id=1 id=2 id=3 发现结果不一样,尝试 : ">4","=4","<4" : 在自己的环境下验证一下: 爆一下数据库: id=(ascii(substr(database(),1,1))>32) ''' @Modify Time @Author ------------ ------- 2019/10/25 19:28 laoalo ''' import requests from lxml import…
学完今天我保证你自己可以至少写50行代码 明天,还在等你 回顾day1 小练习1: 小练习2: 小练习3: 好了激情的的一天已经过去了正式开始,day2的讲解         Day2 目录: 格式化输出 掌握字符串格式的方法 基本运算符 掌握基本的几种运算符 流程控制之 if...else... 理解和掌握基本的流程控制 掌握缩进的重要性 考试成绩小游戏 流程控制之for循环 for循环语句 掌握break continue 控制语句 能独自写出作业的小游戏 格式化输出篇 格式化输出 现在有一…
BUUCTF-[CISCN2019 总决赛 Day2 Web1]Easyweb 就给了一个这个... 先打上robots.txt看看 发现有源码备份,但不是index.php.bak... 看源码发现有image.php试一下,源码备份成功 <?php include "config.php"; $id=isset($_GET["id"])?$_GET["id"]:"1"; $path=isset($_GET[&quo…
[课程主题]主题:5天,一起从零开始学习BPM[课程形式]1.为期5天的短任务学习2.每天观看一个视频,视频学习时间自由安排. [第二天课程] Step 1 软件下载:H3 BPM10.0全开放免费下载:http://bbs.h3bpm.com/read.php?tid=861&fid=11 Step 2 安装资料:参考本博的"安装资料"分类 Step 3 产品在线帮助浏览:http://bbs.h3bpm.com/read.php?tid=286&fid=11 Ste…
    最近帮一个客户搭建跨洋的合并复制,由于数据库非常大,跨洋网络条件不稳定,因此只能通过备份初始化,在初始化完成后向海外订阅端插入数据时发现报出如下错误: Msg 548, Level 16, State 2, Line 2 The insert failed. It conflicted with an identity range check constraint in database %s, replicated table %s, column %s. If the identit…
在Java位运算总结-leetcode题目博文中总结了Java提供的按位运算操作符,今天又碰到LeetCode中一道按位操作的题目 Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive. For example, given the range [5, 7], you should return 4. 题意:…
Assume you have an array of length n initialized with all 0's and are given k update operations. Each operation is represented as a triplet: [startIndex, endIndex, inc] which increments each element of subarray A[startIndex ... endIndex] (startIndex…
Given an integer array nums, return the number of range sums that lie in [lower, upper] inclusive.Range sum S(i, j) is defined as the sum of the elements in nums between indices i and j (i ≤ j), inclusive. Note:A naive algorithm of O(n2) is trivial.…
Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2, col2). The above rectangle (with the red border) is defined by (row1, col1) = (2, 1) and (row2, co…
Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. The update(i, val) function modifies nums by updating the element at index i to val. Example: Given nums = [1, 3, 5] sumRange(0, 2) -> 9 update(1, 2…
Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2, col2). The above rectangle (with the red border) is defined by (row1, col1) = (2, 1) and (row2, co…
Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Given nums = [-2, 0, 3, -5, 2, -1] sumRange(0, 2) -> 1 sumRange(2, 5) -> -1 sumRange(0, 5) -> -3 Note: You may assume that the array do…
Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive. For example, given the range [5, 7], you should return 4. Credits:Special thanks to @amrsaqr for adding this problem and creatin…
Day1 T1 toy 本题考查你会不会编程. //toy //by Cydiater //2016.11.19 #include <iostream> #include <cstdlib> #include <cstdio> #include <cstring> #include <string> #include <algorithm> #include <queue> #include <map> #in…
python中的range功能非常好用 for i in range(100): print(i) 现在利用C++11的基于范围的for循环特性实现C++中的range功能 class range { public: range(int end) { _begin = 0; _end = end; _step = 1; } range(int begin, int end, int step=1) { _begin = begin; _end = end; _step = step; if (!…
报错: 原来用的python3.5版本后来改为2.7出现了这个错误里面的中文无法显示 UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 0: ordinal not in range(128) 解决办法: 文件抬头加入 import sys reload(sys) sys.setdefaultencoding("utf-8") 原因: 提示中的“ordinal not )”,意思是,字符不在128范…
需求: 1. 启动程序后,用户通过账号密码登录,然后打印商品列表. 2. 允许用户根据商品编号购买商品. 3. 用户选择商品后,检测余额是否足够,够就直接扣款,不够就提醒充值. 4. 可随时退出,退出时,打印已购买的商品和余额. #!/usr/bin/env python # -*- coding: utf-8 -*- count = 0 # 计数器 username = "aaa" # 登录用户名 userpassword = "asd" # 登录密码 #创建黑名…