Skip to content

Commit

Permalink
class with variables
Browse files Browse the repository at this point in the history
  • Loading branch information
rakeshlinux committed Apr 30, 2018
1 parent 770dd06 commit a65f8a4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
13 changes: 13 additions & 0 deletions classes/class1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class student():
name = "rakesh"
website ="binarynote.com"
expertise ="PHP, CSS, HTML,JavaScript,JQuery,WordPress and Now Python Django"

def showMessage(self):
print("This is a demo message from class ")

s = student()

print("Default Behaviour of Class Members in Python\n\n\nName : ",s.name)
print("website : ", s.website)
print("Expertise :", s.expertise,"\n")
10 changes: 5 additions & 5 deletions classes/classDemo.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
class student():
class student:
def read_data(self,name,fatherName,stream):
name = self.name;
fatherName = self.fatherName
stream = self.stream
self.name = name
self.fatherName = fatherName
self.stream = stream

def show_data(self):
print("Student Name ",self.name)
print("father Name ",self.fatherName)
print("Stream Name ",self.stream)

student s;
s = student()
s.read_data('rakesh','jagdish','computer')
s.show_data()

0 comments on commit a65f8a4

Please sign in to comment.