老师,在Oracle自带客户端可以查看表结构,在图形界面不能查看表结构,这是为啥?
这个b选项怎么解释啊
import pickle with open("data.dat","wb") as f: name = "高淇" age = 34 score = [90,80,70] resume = {'name':name,'age':age,'score':score} #简历 pickle.dump(resume,f) with open("data.dat","rb") as f: resume2 = pickle.load(f) print(resume2)
老师这个为啥报错啊
class Person: def work(self): print('你处于在职状态中') def play_game(self): print('{0}在打游戏'.format(self)) def work2(s): print('好好工作,努力赚钱,迎娶媳妇{0}'.format(s)) p = Person() Person.play =play_game p.play() Person.work = work2 p.work()
老师,这里的动态给类增加新的方法,可以理解为该方法是该类属性的方法,从属于play和work属性的。
老师你这个插件怎么下载安装呢?
#测试运算符的重载 class Person: def __init__(self,name): self.name=name def __add__(self,other): if isinstance(other,Person): return "{0}--{1}".format(self.name,other.name) else: return "不是同类,不能相加" def __mul__(self,other): if isinstance(other,int): return self.name*other else: return "不是同类,不能相乘" p1=Person('高琪') p2=Person("高希希") x=p1+p2 print(x) print(p1*3)
老师
if isinstance(other,Person):和if isinstance(other,int):这两句代码不明白。int是什么?
select * from emp e right join emp m on m.mgr=e.empno select * from emp e left join emp m on e.mgr=m.empno
这两个语句,得到的结果不应该是一样的吗?为啥检索的出来的不同?老师
>>> a=[1,2,3,4] >>> a.delete(2,30) Traceback (most recent call last): File "<pyshell#39>", line 1, in <module> a.delete(2,30) AttributeError: 'list' object has no attribute 'delete' >>> a.delete(2,3) Traceback (most recent call last): File "<pyshell#40>", line 1, in <module> a.delete(2,3) AttributeError: 'list' object has no attribute 'delete'
老师,del()怎么使用呢,怎么删除元素呢。
老师,制表符有什么用,我用空格不也行吗?
print(type(str)) print(type(dict)) print(type(int)) print(type(list)) print(type(tuple)) print(type(set)) def test(): pass class Person(): def run(self): pass a = Person() c = a.run print(type(test)) print(type(c)) print(type(function)) print(type(method))
二、运行结果
三、疑问
老师你好,请问6个基本数据类型的模具类是type .python中一切都是对象,type 类实例化了所类,所有类继承与object类,用type方法 查看方法和函数的类型却报错了,他们不是type类的实例吗,
老师,可以提个建议吗?在web项目中教学时传递数据可以多用中文吗,都zhangsan了就不能用张三说下乱码的问题吗?
我在设置请求编码时有一个疑问,我是应该在doPost中设置请求编码可以解决中文乱码问题,而在获取请求数据的方法createUser中设置就不能解决,请求数据不是通过createUser方法获取的吗,为什么它里面设置反而不行
@Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { req.setCharacterEncoding("utf-8"); // 获取请求中flag的值 String flag = req.getParameter("flag"); if ("addUser".equals(flag)){ // 添加用户 this.addUser(req,resp); } }
private User createUser(HttpServletRequest req)throws IOException{ req.setCharacterEncoding("utf-8"); String username = req.getParameter("username"); String usersex = req.getParameter("usersex"); User user = new User(); user.setUsername(username); user.setUsersex(usersex); return user; }
视频中16分13秒处为什么print(e)没有输出?
老师你能把你上课的Word共享一下嘛,第二章上课Word没有
package com.itbaizhan; public class MyInteger { private final int value; private static final int LOW=-128; private static final int HIGH=127; private static MyInteger[] cache; //缓存【-128,127】之间的数字 static{ cache =new MyInteger[HIGH-LOW+1]; for(int i=LOW;i<=HIGH;i++){ cache[i-LOW]=new MyInteger(i); } } public MyInteger(int value){ this.value=value; } public int intValue(){ return value; } public static void main(String[] agrs){ } } 第五行代码: private static MyInteger[] cache; //缓存【-128,127】之间的数字
与
private static int[] a;
有什么差别吗?我主要不太理解的是MyInteger[],而不是int[]
删除数据的为啥要加逗号啊,加了和不加有啥区别
if __name__=='__main__':
args = (3,)
delete(args)
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637