码迷,mamicode.com
首页 >  
搜索关键字:def    ( 28626个结果
DRF源码刨析
一、开发模式 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
Python使用random.shuffle()随机打乱字典排序
###示例.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
C函数调用过程原理及函数栈帧分析
原文链接:https://www.cnblogs.com/sddai/p/9762968.html 在x86的计算机系统中,内存空间中的栈主要用于保存函数的参数,返回值,返回地址,本地变量等。一切的函数调用都要将不同的数据、地址压入或者弹出栈。因此,为了更好地理解函数的调用,我们需要先来看看栈是怎么 ...
分类:其他好文   时间:2021-01-20 12:00:28    阅读次数:0
148-191. 位1的个数
编写一个函数,输入是一个无符号整数(以二进制串的形式),返回其二进制表达式中数字位数为 '1' 的个数(第一个我弄得,但是二进制更好) class Solution(object): def hammingWeight1(self, n): """ :type n: int :rtype: int ...
分类:其他好文   时间:2021-01-20 11:45:10    阅读次数:0
Python学习-第一遍QA
字符串反转? 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
Python二维数组,for循环,函数
函数 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
算法入门(五)排序-selece_sor
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 Cookie,有时也用其复数形式Cookies,指某些网站为了辨别用户身份、进行session跟踪而储存在用户本地终端上的数据(通常经过加密)。Cookie最早是网景公司的前雇员Lou Montulli在1993年3月的发明。Cookie是由服务器端生成,发送给User-Agent(一 ...
分类:其他好文   时间:2021-01-19 11:41:11    阅读次数:0
CodeForces - 1461B Find the Spruce(递推)
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 知识要点:多值参数
定义支持多值参数的函数 有时需要一个函数能够处理参数个数不确定,这是需要使用多值参数。 Python中有两种多值参数: 参数名前增加一个 * 可以接收元组 参数名前增加一个 ** 可以接收字典 【多值参数传递】 复制代码 def demo(num, *nums, **person): print(n ...
分类:编程语言   时间:2021-01-18 11:32:19    阅读次数:0
28626条   上一页 1 ... 58 59 60 61 62 ... 2863 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!