Skip to content

Instantly share code, notes, and snippets.

@woosal1337
Created July 3, 2021 03:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save woosal1337/3d40ce900e20ab5e9ccfd61ef0ef9c99 to your computer and use it in GitHub Desktop.
Save woosal1337/3d40ce900e20ab5e9ccfd61ef0ef9c99 to your computer and use it in GitHub Desktop.
GitHub-Copilot-Demo
class Student():
def __init__(self, name, age):
self.name = name
self.age = age
def show(self):
print(self.name)
print(self.age)
def set_age(self, age):
self.age = age
def set_name(self, name):
self.name = name
def get_age(self):
return self.age
def get_name(self):
return self.name
student = Student("Tom", 18)
class WorkingStudent(Student):
def __init__(self, name, age, salary):
super().__init__(name, age)
self.salary = salary
def age(year):
"""
Takes year as input and return the age
"""
age = 2021 - year
return age
year = int(input("Enter the year you were born: "))
print("Your age is", age(year),".")
def convert_minute_to_seconds(minutes):
"""
Function to convert minutes to seconds
"""
return minutes * 60
def convert_seconds_to_minutes(seconds):
"""
Function to convert seconds to minutes
"""
return seconds / 60
def convert_time_to_seconds(time):
"""
Function to convert time to seconds
"""
minutes = time.hour * 60 + time.minute
seconds = minutes * 60 + time.second
return seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment