第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
from math import *
print(sin(0))
print(cos(0))
# common.py
def say_hello(name):
print('Hello,{}'.format(name))
say_hello('LiuYF')
class Fib(object):
def __init__(self):
self.res = []
def __call__(self,num):
for i in range(num):
self.res.append(i)
if i > 1:
self.res[i] = self.res[i - 1] + self.res[i - 2]
return self.res
f = Fib()
print(f(10))
class Student(object):
def __init__(self,name,ge):
self.name = name
self.ge = ge
def __str__(self):
return 'Student: {},{}'.format(self.name,self.ge)
def __repr__(self):
return 'Student:{},{}'.format(self.name,self.ge)
s = Student('憶雪','女',88)
print(s)
# -*- coding: utf-8 -*-
class Person(object):
def __init__(self,name,gender):
self.name = name
self.gender = gender
class Teacher(Person):
def __init__(self,name,gender,su):
super(Teacher,self).__init__(name,gender)
self.su= su
teacher = Teacher('弘','男','歷')
class Animal(object):
def __init__(self,name,age,location):
self.__name = name
self.__age = age
self.__location = location
def g(self):
return 'n = {}, a = {}, l = {}'.format(self.__name,self.__age,self.__location)
dog = Animal('T',5,'A')
print(dog.g())
class Animal(object):
_count = 0
def __init__(self,name,age):
self.name = name
self.age = age
Animal._count += 1
dog = Animal('kg',12)
print(dog._count)
print(Animal._count)
class Animal(object):
def __init__(self,name,age):
self.name = name
self.age = age
dog = Animal('Tom',3)
cat = Animal('Lily',2)
print(dog.name)
print(dog.age)
print(cat.name)
print(cat.age)

最新回答 / 史潔_glntBJ
將光標移動到文件末尾
class Animal(object):
pass

dog = Animal()
cat = Animal()
print(dog)
print(cat)
print(dog == cat)

最新回答 / 慕容0245657
"用pow()實現(xiàn)的話,該怎么寫?"什么需求需要用pow()實現(xiàn)
靜態(tài),方法,類訪問

最新回答 / tinghai
執(zhí)行報錯:Traceback (most recent call last):? File "E:\python\example\lizi.py", line 283, in <module>? ? student = Student('Alice',100)? ? ? ? ? ? ? ^^^^^^^^^^^^^^^^^^^^? File "E:\python\example\lizi.py", line 280, in __init__? ? super(Student, self).__i...
這個精度問題搞得人有點懵,還以為錯了呢
‌repr是“representation”的縮寫,意為“表示”或“表達”‌。
super詳解:https://www.runoob.com/w3cnote/python-super-detail-intro.html
課程須知
本課程是Python入門的后續(xù)課程 1、掌握Python編程的基礎(chǔ)知識 2、掌握Python函數(shù)的編寫 3、對面向?qū)ο缶幊逃兴私飧?/dd>
老師告訴你能學到什么?
1、什么是函數(shù)式編程 2、Python的函數(shù)式編程特點 3、Python的模塊 4、Python面向?qū)ο缶幊?5、Python強大的定制類

微信掃碼,參與3人拼團

微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號

友情提示:

您好,此課程屬于遷移課程,您已購買該課程,無需重復購買,感謝您對慕課網(wǎng)的支持!

本次提問將花費2個積分

你的積分不足,無法發(fā)表

為什么扣積分?

本次提問將花費2個積分

繼續(xù)發(fā)表請點擊 "確定"

為什么扣積分?

舉報

0/150
提交
取消