why is this giving none | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

why is this giving none

class Player: def __init__(self, name, level): self.name = name self.level = level def intro(self): print(self.name + " (Level " + self.level + ")") #your code goes here player = input() lev = input() player = Player(player,lev) print(player.intro()) This prints player (Level lev) None why this gives none as output with print?

27th Apr 2022, 5:35 AM
Tarun
1 Answer
+ 2
intro() does not return any value. intro() already prints and you try to print again
27th Apr 2022, 6:15 AM
Lisa
Lisa - avatar