# n,k=input().split()
# n=int(n)
# k=int(k)
# for i in range(n):
# for j in range(n):
# if i==0 or i==n-1 or j==0 or j==n-1 or (i+j+1)%k==0:
# print("*", end='')
# else:
# print(' ', end='')
# print()
# n=input()
# n=int(n)
#
#
# for i in range(n):
#
# for j in range(n):
# if i==0 and j==j
# n = int(input())
#
# map = []
# for i in range(n):
# v = []
# for j in range(n):
# v.append(0)
# map.append(v)
#
# for i in range(n):
# for j in range(n):
# print(map[i][j], end=' ')
# print()
#
# n = int(input())
# map = []
# for i in range(n):
# map.append(0)
# n = int(input())
# data = input().split()
#
# print(data)
#
# for i in range(len(data)):
# data[i] = int(data[i])
#
# print(data)
# class name:
# def __init__(self):
# self.a = 10
# self.b = 20
#
# def solved(self, a, b):
# self.a = a
# self.b = b
#
# def result(self):
# return self.a + self.b
#
# x = name()
# print(x.a)
#
# x.solved(100, 200)
# print(x.a)
#
# print(x.result())
# class A:
# def __init__(self):
# self.a = 0
#
# def input(self, a):
# self.a = a
#
# def B(self):
# if (self.a - 2013) % 10 + 9 > 9:
# return (self.a - 2013) % 10 - 1
# else:
# return 9
#
# def C(self):
# if (self.a - 2013) % 12 + 5 > 11:
# return chr((self.a - 2013) % 12 - 7 + 65)
# else:
# return chr((self.a - 2013) % 12 + 5 + 65)
#
# x = A()
#
# k = input()
# k = int(k)
#
# x.input(k)
#
# print(x.C(),end='')
# print(x.B())
# 학생정보 관리 프로그램
# 학생 정보를 입력받아서 컨트롤하는 프로그램을 작성하시오.
#
# 기본정보: 이름, 나이, 성별, 키, 몸무게
# 학생정보: 국어, 수학, 영어, 과학, 체육
#
import random
point = 0
class humanInfo:
def __init__(self):
self.name1 = None
self.name2 = None
self.name3 = None
self.letter = []
for i in range(26):
self.letter.append(chr(65 + i))
try:
x = random.randint(0, 25)
y = random.randint(0, 25)
z = random.randint(0, 25)
self.name1 = self.letter[x]
self.name2 = self.letter[y]
self.name3 = self.letter[z]
except:
print(x, y, z)
self.name = self.name1 + self.name2 + self.name3
self.age = random.randint(14, 16)
self.height = random.randint(155, 185)
self.weight = random.randint(40, 80)
self.gender = None
if random.randint(0, 2) == 0:
self.gender = "male"
else:
self.gender = "female"
def show(name, first, second, perfom):
print(name+': ' + str(first) + ', ' + str(second) + ', ' + str(perfom), end=' ')
class subject:
def __init__(self, name):
self.name = name
self.performance = random.randint(25, 51)
self.firstexam = random.randint(0, 26)
self.seconexam = random.randint(0, 26)
self.calculate = self.performance + self.firstexam + self.seconexam
def view(self):
show(self.name, self.firstexam, self.seconexam, self.performance)
class gradeInfo:
def __init__(self):
self.Korean = subject('Korean')
self.English = subject('English')
self.Math = subject('Math')
self.Science = subject('Science')
self.PE = subject('PE')
global point
self.total = (self.Korean.calculate + self.English.calculate + self.Math.calculate + self.Science.calculate + self.PE.calculate)
point += self.total
class student:
def __init__(self):
self.privateData = humanInfo()
self.publicData = gradeInfo()
def viewer(self):
print(self.privateData.name1+self.privateData.name2+self.privateData.name3, end=': ')
print(self.privateData.age, end=' ')
print(self.privateData.gender, end=' ')
print(self.privateData.height, end=' ')
print(self.privateData.weight, end=' ')
self.publicData.Korean.view()
self.publicData.English.view()
self.publicData.Math.view()
self.publicData.Science.view()
self.publicData.PE.view()
print()
classroom = []
classroom1 = []
for i in range(25):
x = student()
classroom.append([x, x.publicData.total])
print(len(classroom), len(classroom[0]))
for i in range(25):
print(classroom[i][0].privateData.name, classroom[i][1])
# for i in range(25):
# for j in range(i, 1, -1):
# # print('>', end='')
# print(point, classroom[0])
# if i == 0:
# classroom[0] = point
# classroom1[0] = student()
# print('.', end='')
# elif classroom[i-j] > point:
# for k in range(0, j):
# classroom[i-k] = classroom[i-k-1]
# classroom1[i-k] = classroom1[i-k-1]
# classroom[i-j] = point
# classroom1[i-j] = student()
# print(type(classroom1[i-j]))
# for i in range(25):
# x = classroom1[i]
# # x.viewer()
top of page

실제 작동 상태를 확인하려면 라이브 사이트로 이동하세요.
2022.06.11.
2022.06.11.
댓글 0개
좋아요
댓글(0)
더 이상 게시물에 대한 댓글 기능이 지원되지 않습니다. 자세한 사항은 사이트 소유자에게 문의하세요.
bottom of page


