So, basically my code is printing None after printing the statement I want it to print. How can I stop this None from printing
问题 So, basically my code is printing None after printing the statement I want it to print. How can I stop this None from printing class Panda: def __init__(self,name,gender,age): self.name=name self.gender=gender self.age=age def sleep(self,time=None): self.time=time if self.time!=None: if self.time>=3 and self.time<=5: self.food='Mixed Veggies' if self.time>=6 and self.time<=8: self.food='Eggplant & Tofu' if self.time>=9 and self.time<=11: self.food='Broccoli Chicken' print('{} sleeps {} hours