40강.
randomNum = random.sample(range(1,101) , 10) #범위(?, +1!!), 개수
41강.
for n in range(100):
visitor.append(random.randint(1, 100)) #해당 범위에서 하나씩 뽑기
#나이를 집어넣는거 - 그래서 나이를 count 하자
42강.
idx = 0
while True :
if idx >= len(numbers) : #즉 언제까지 돌아라~ 이게 있어야함
break
if numbers.count(numbers[idx]) >= 2 :
numbers.remove(numbers[idx])
continue #다시 while문 돌리기
#삭제하면 앞으로 당겨지기에 밑에 idx+=1
idx += 1
print(f'numbers : {numbers}')
44강.
#이렇게 하면
grade4 = (minScore , minScore)
scores = scores + grade4
print(scores)
> 출력 : ((3.7, 4.2), (2.9, 4.3), (4.1, 4.2), 4.3, 4.3)
> 리스트 변환후 넣고 다시 튜플 변환
targetScore = round((4.0 * 8) - sum, 2) #왜 이걸 몰랐을까나.. 휴ㅠㅠ
targetAvg = round((4.0 * 8) - sum, 2)
minScore = round(targetScore / 2, 1)