Created
July 3, 2021 03:51
-
-
Save woosal1337/3d40ce900e20ab5e9ccfd61ef0ef9c99 to your computer and use it in GitHub Desktop.
GitHub-Copilot-Demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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),".") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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