Fill in the blanks to create a class with a method sayHi(). | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Fill in the blanks to create a class with a method sayHi().

class Student__ def __init__(self, name): self.name = name __ sayHi(__): print("Hi from "+__.name) s1 = Student("Amy") s1.sayHi()

8th Feb 2021, 6:36 AM
𝐀𝐲𝐞𝐬𝐡𝐚 𝐍𝐨𝐨𝐫
𝐀𝐲𝐞𝐬𝐡𝐚 𝐍𝐨𝐨𝐫 - avatar
7 Answers
+ 3
Thankssss
8th Feb 2021, 7:04 AM
𝐀𝐲𝐞𝐬𝐡𝐚 𝐍𝐨𝐨𝐫
𝐀𝐲𝐞𝐬𝐡𝐚 𝐍𝐨𝐨𝐫 - avatar
+ 2
class Student: def __init__(self, name): self.name=name def sayHi(self): print("Hi from "+self.name) s1=Student("Amy") s1.sayHi()
8th Feb 2021, 6:55 AM
NaSaPaKri
NaSaPaKri - avatar
+ 1
sayHi(___) ???
8th Feb 2021, 7:02 AM
𝐀𝐲𝐞𝐬𝐡𝐚 𝐍𝐨𝐨𝐫
𝐀𝐲𝐞𝐬𝐡𝐚 𝐍𝐨𝐨𝐫 - avatar
+ 1
self
8th Feb 2021, 7:03 AM
NaSaPaKri
NaSaPaKri - avatar
0
This is not python! It seems python but it's not There is no indentation and there are even things on the same line that should be on different ones!
8th Feb 2021, 6:45 AM
Angelo
Angelo - avatar
0
no problem, you can mark the comment as answered...
8th Feb 2021, 7:05 AM
NaSaPaKri
NaSaPaKri - avatar
0
def and name
9th Feb 2021, 1:54 PM
Ireneo language