<reponame>hanwhhanwh/python-test<gh_stars>0

class Employee:
    pass

john = Employee()  # Create an empty employee record

# Fill the fields of the record
john.name = '<NAME>'
john.dept = 'computer lab'
john.salary = 1000

print(type(john))

chae = Employee()  # Create an empty employee record
chae.Name = '채윤성'
chae.department = 'EdgeAI'

print(type(chae))

if type(john) == type(chae):
    print("john and chae is same class")

class Reverse:
    """Iterator for looping over a sequence backwards."""
    def __init__(self, data):
        self.data = data
        self.index = len(data)

    def __iter__(self):
        return self

    def __next__(self):
        if self.index == 0:
            raise StopIteration
        self.index = self.index - 1
        return self.data[self.index]

rev = Reverse('spam')
# iter(rev)
for char in rev:
    print(char)


Vector = list[float]

def scale(scalar: float, vector: Vector) -> Vector:
    return [scalar * num for num in vector]

# typechecks; a list of floats qualifies as a Vector.
new_vector = scale(2.0, [1.0, -4.2, 5.4])
print(new_vector)




class Employee:
    pass

john = Employee()  # Create an empty employee record

# Fill the fields of the record
john.name = '<NAME>'
john.dept = 'computer lab'
john.salary = 1000

print(type(john))

chae = Employee()  # Create an empty employee record
chae.Name = '채윤성'
chae.department = 'EdgeAI'

print(type(chae))

if type(john) == type(chae):
    print("john and chae is same class")

class Reverse:
    """Iterator for looping over a sequence backwards."""
    def __init__(self, data):
        self.data = data
        self.index = len(data)

    def __iter__(self):
        return self

    def __next__(self):
        if self.index == 0:
            raise StopIteration
        self.index = self.index - 1
        return self.data[self.index]

rev = Reverse('spam')
# iter(rev)
for char in rev:
    print(char)


Vector = list[float]

def scale(scalar: float, vector: Vector) -> Vector:
    return [scalar * num for num in vector]

# typechecks; a list of floats qualifies as a Vector.
new_vector = scale(2.0, [1.0, -4.2, 5.4])
print(new_vector)
# Create an empty employee record # Fill the fields of the record # Create an empty employee record Iterator for looping over a sequence backwards. # iter(rev) # typechecks; a list of floats qualifies as a Vector.