一、开发模式 1、前后端不分离 前后端放在一块写 2、前后端分离 2.1、前端开发 2.2、后端开发 为前端提供API开发 永远返回HttpResponse 3、Django FBV、 CBV 3.1、FBV def users(request): if request.method == 'GET ...
分类:
其他好文 时间:
2021-01-21 10:44:00
阅读次数:
0
###示例.1 import random from random import shuffle x = [[i] for i in range(10)] shuffle(x) print(x) 运行结果: [[1], [2], [5], [0], [7], [9], [3], [8], [4], ...
分类:
编程语言 时间:
2021-01-21 10:36:13
阅读次数:
0
原文链接:https://www.cnblogs.com/sddai/p/9762968.html 在x86的计算机系统中,内存空间中的栈主要用于保存函数的参数,返回值,返回地址,本地变量等。一切的函数调用都要将不同的数据、地址压入或者弹出栈。因此,为了更好地理解函数的调用,我们需要先来看看栈是怎么 ...
分类:
其他好文 时间:
2021-01-20 12:00:28
阅读次数:
0
编写一个函数,输入是一个无符号整数(以二进制串的形式),返回其二进制表达式中数字位数为 '1' 的个数(第一个我弄得,但是二进制更好) class Solution(object): def hammingWeight1(self, n): """ :type n: int :rtype: int ...
分类:
其他好文 时间:
2021-01-20 11:45:10
阅读次数:
0
字符串反转? def reverse(s): if s == "": return s else: print(s[1:]) return reverse(s[1:]) + s[0] def main(): num = "1234" print("num="+num) num = reverse(n ...
分类:
编程语言 时间:
2021-01-19 12:28:34
阅读次数:
0
函数 1 def check(x,y): 2 if x<0 or x>n or y>m or y<0: 3 return False 4 else : 5 return True 类似C的 1 int check(int x,int y) 2 { 3 if(x<0 || x>n || y>m || ...
分类:
编程语言 时间:
2021-01-19 12:03:46
阅读次数:
0
def select_sort_simple(li): li_new = [] for i in range(len(li)): min_val = min(li) li_new.append(min_val) li.remove(min_val) return li_new def select_ ...
分类:
编程语言 时间:
2021-01-19 11:43:46
阅读次数:
0
Cookie Cookie,有时也用其复数形式Cookies,指某些网站为了辨别用户身份、进行session跟踪而储存在用户本地终端上的数据(通常经过加密)。Cookie最早是网景公司的前雇员Lou Montulli在1993年3月的发明。Cookie是由服务器端生成,发送给User-Agent(一 ...
分类:
其他好文 时间:
2021-01-19 11:41:11
阅读次数:
0
CF1461B Find the Spruce 题目大意: 求指定类型图案的数量。 思路: 一个很巧妙的递推式。 注意从下往上进行递推。 Code: #include <bits/stdc++.h> using namespace std; const int N = 510; int n, m; ...
分类:
其他好文 时间:
2021-01-19 11:39:58
阅读次数:
0
定义支持多值参数的函数 有时需要一个函数能够处理参数个数不确定,这是需要使用多值参数。 Python中有两种多值参数: 参数名前增加一个 * 可以接收元组 参数名前增加一个 ** 可以接收字典 【多值参数传递】 复制代码 def demo(num, *nums, **person): print(n ...
分类:
编程语言 时间:
2021-01-18 11:32:19
阅读次数:
0