Skip to content

Update class.py #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
4 changes: 4 additions & 0 deletions add.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
a = int(input('enter first number')
b = int(input('enter second number')
c = a + b
print(c)
13 changes: 9 additions & 4 deletions class.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
class Person:
def __int__(self,name,age):
self.name = name
self.age = age
def __repr__(self):
return f"My name is {self.name} and my age {self.age}"

age = 18

def name(self, name):
return list(name)
def name(self):
return self.name
def age(self):
return self.age
4 changes: 4 additions & 0 deletions divide.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
a = int(input('enter first number')
b = int(input('enter second number')
c = a / b
print(c)
2 changes: 2 additions & 0 deletions greeting.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
n = input('enter your name')
print('hello' n)
1 change: 1 addition & 0 deletions greetings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("hello there")
1 change: 1 addition & 0 deletions how to input strings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a = input("enter a name")
2 changes: 2 additions & 0 deletions how to input.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#how to input a numbeer
a = int(input('enter a number')
1 change: 1 addition & 0 deletions how to use print.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print('hello, to use print, syntax is print()')
4 changes: 4 additions & 0 deletions mul.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
a = int(input('enter first number')
b = int(input('enter second number')
c = a * b
print(c)
4 changes: 4 additions & 0 deletions sub.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
a = int(input('enter first number')
b = int(input('enter second number')
c = a - b
print(c)