![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
文章平均质量分 92
Fan_Coder
这个作者很懒,什么都没留下…
展开
-
python django 根路由---->子路由
python django 根路由---->子路由python django-admin.py startproject projectname #新建django项目python manaeg.py runserver 127.0.0.1:8000 #运行服务python manage.py startapp appname #新建子app根路由----》子路由方法0.前提—先新建子apppython manage.py startapp txb然后新建一个路由 u原创 2020-09-16 17:17:30 · 1205 阅读 · 0 评论 -
不定长参数--python
不定长参数如果向一个函数传递的参数的数量每次都不同,想要让函数去做每次相加或者其他的事的时候,可以用(*+变量名)传递不定长参数,传进去以后的变量会变成一个元组def sum (*a): result=0 print (type(a)) for i in a: result+=i return resultresult = sum(1,2,3)print (result)运行结果<class 'tuple'> # a是一个元组,这里原创 2020-07-18 11:59:38 · 347 阅读 · 0 评论