mac : montery 12.0 v

vscode 를 디버깅 할때 문제가 생겻따 자꾸 2.7를 부르는 것이다

그럼으로 파이썬 설정을 하기위해 파이썬 위치를 찾고 디폴틀값을 수정해줘야한다

 

 

{
    "workbench.editorAssociations": {
        "*.ipynb": "jupyter.notebook.ipynb"
    },
    "window.zoomLevel": 1,
    "git.autofetch": true,
    "terminal.integrated.inheritEnv": false,
    "python.defaultInterpreterPath": "/usr/local/bin/python3.9"
}

이것으로 정상 작동

블로그 이미지

Or71nH

,
from flask import Flask, render_template, request, redirect
app = Flask("SuperScrapper")
import requests

import os
os.system("clear")

base_url = "http://hn.algolia.com/api/v1"

# This URL gets the newest stories.
newurl = f"{base_url}/search_by_date?tags=story"

# This URL gets the most popular stories
popularurl = f"{base_url}/search?tags=story"

DataBagenew = []
innew = []
DataBagePopular = []
inpopular = []
DataBagecom = []


def populardataget():
    popular = requests.get(popularurl)
    populardic = popular.json()
    for i in populardic['hits']:
        if i['num_comments'] != 0 and i['title'] != None:
            if i['objectID'] not in inpopular:
                inpopular.append(i['objectID'])
                DataBagePopular.append(i)
    return DataBagePopular


def newdataget():
    new = requests.get(newurl)
    populardic = new.json()
    for i in populardic['hits']:
        if i['title'] != None:
            if i['objectID'] not in innew:
                innew.append(i['objectID'])
                DataBagenew.append(i)
    return DataBagenew


@app.route("/")
def home():
    order_by = request.args.get('order_by')
    print(order_by)
    if order_by == "new":
        if DataBagenew:
            DataBage = DataBagenew
        else:
            DataBage = newdataget()
        return render_template("mvp.html", data=DataBage, order=order_by)
    elif order_by == "popular":
        if DataBagePopular:
            DataBage = DataBagePopular
        else:
            DataBage = populardataget()
        return render_template("mvp.html", data=DataBage, order=order_by)
    else:
        if DataBagePopular:
            DataBage = DataBagePopular
        else:
            DataBage = populardataget()
        return render_template("mvp.html", data=DataBage, order=order_by)


@app.route("/<number>")
def comment(number):
    com = requests.get(f"{base_url}/items/{number}")
    comdic = com.json()
    return render_template("mvpcom.html", data = comdic)

def startgame():
  app.run(host="0.0.0.0")
/* MVP.css v1.6.2 - https://github.com/andybrewer/mvp */

:root {
    --border-radius: 5px;
    --box-shadow: 2px 2px 10px;
    --color: #118bee;
    --color-accent: #118bee15;
    --color-bg: #fff;
    --color-bg-secondary: #e9e9e9;
    --color-secondary: #920de9;
    --color-secondary-accent: #920de90b;
    --color-shadow: #f4f4f4;
    --color-text: #000;
    --color-text-secondary: #999;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --hover-brightness: 1.2;
    --justify-important: center;
    --justify-normal: left;
    --line-height: 1.5;
    --width-card: 285px;
    --width-card-medium: 460px;
    --width-card-wide: 800px;
    --width-content: 1080px;
}

/*
@media (prefers-color-scheme: dark) {
    :root {
        --color: #0097fc;
        --color-accent: #0097fc4f;
        --color-bg: #333;
        --color-bg-secondary: #555;
        --color-secondary: #e20de9;
        --color-secondary-accent: #e20de94f;
        --color-shadow: #bbbbbb20;
        --color-text: #f7f7f7;
        --color-text-secondary: #aaa;
    }
}
*/

/* Layout */
article aside {
    background: var(--color-secondary-accent);
    border-left: 4px solid var(--color-secondary);
    padding: 0.01rem 0.8rem;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-family);
    line-height: var(--line-height);
    margin: 0;
    overflow-x: hidden;
    padding: 1rem 0;
}

footer,
header,
main {
    margin: 0 auto;
    max-width: var(--width-content);
    padding: 2rem 1rem;
}

hr {
    background-color: var(--color-bg-secondary);
    border: none;
    height: 1px;
    margin: 4rem 0;
}

section {
    display: flex;
    flex-wrap: wrap;
    justify-content: var(--justify-important);
}

section aside {
    border: 1px solid var(--color-bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow) var(--color-shadow);
    margin: 1rem;
    padding: 1.25rem;
    width: var(--width-card);
}

section aside:hover {
    box-shadow: var(--box-shadow) var(--color-bg-secondary);
}

section aside img {
    max-width: 100%;
}

[hidden] {
    display: none;
}

/* Headers */
article header,
div header,
main header {
    padding-top: 0;
}

header {
    text-align: var(--justify-important);
}

header a b,
header a em,
header a i,
header a strong {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
}

header nav img {
    margin: 1rem 0;
}

section header {
    padding-top: 0;
    width: 100%;
}

/* Nav */
nav {
    align-items: center;
    display: flex;
    font-weight: bold;
    justify-content: space-between;
    margin-bottom: 7rem;
}

nav ul {
    list-style: none;
    padding: 0;
}

nav ul li {
    display: inline-block;
    margin: 0 0.5rem;
    position: relative;
    text-align: left;
}

/* Nav Dropdown */
nav ul li:hover ul {
    display: block;
}

nav ul li ul {
    background: var(--color-bg);
    border: 1px solid var(--color-bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow) var(--color-shadow);
    display: none;
    height: auto;
    left: -2px;
    padding: .5rem 1rem;
    position: absolute;
    top: 1.7rem;
    white-space: nowrap;
    width: auto;
}

nav ul li ul li,
nav ul li ul li a {
    display: block;
}

/* Typography */
code,
samp {
    background-color: var(--color-accent);
    border-radius: var(--border-radius);
    color: var(--color-text);
    display: inline-block;
    margin: 0 0.1rem;
    padding: 0 0.5rem;
}

details {
    margin: 1.3rem 0;
}

details summary {
    font-weight: bold;
    cursor: pointer;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: var(--line-height);
}

mark {
    padding: 0.1rem;
}

ol li,
ul li {
    padding: 0.2rem 0;
}

p {
    margin: 0.75rem 0;
    padding: 0;
}

pre {
    margin: 1rem 0;
    max-width: var(--width-card-wide);
    padding: 1rem 0;
}

pre code,
pre samp {
    display: block;
    max-width: var(--width-card-wide);
    padding: 0.5rem 2rem;
    white-space: pre-wrap;
}

small {
    color: var(--color-text-secondary);
}

sup {
    background-color: var(--color-secondary);
    border-radius: var(--border-radius);
    color: var(--color-bg);
    font-size: xx-small;
    font-weight: bold;
    margin: 0.2rem;
    padding: 0.2rem 0.3rem;
    position: relative;
    top: -2px;
}

/* Links */
a {
    color: var(--color-secondary);
    display: inline-block;
    font-weight: bold;
    text-decoration: none;
}

a:hover {
    filter: brightness(var(--hover-brightness));
    text-decoration: underline;
}

a b,
a em,
a i,
a strong,
button {
    border-radius: var(--border-radius);
    display: inline-block;
    font-size: medium;
    font-weight: bold;
    line-height: var(--line-height);
    margin: 0.5rem 0;
    padding: 1rem 2rem;
}

button {
    font-family: var(--font-family);
}

button:hover {
    cursor: pointer;
    filter: brightness(var(--hover-brightness));
}

a b,
a strong,
button {
    background-color: var(--color);
    border: 2px solid var(--color);
    color: var(--color-bg);
}

a em,
a i {
    border: 2px solid var(--color);
    border-radius: var(--border-radius);
    color: var(--color);
    display: inline-block;
    padding: 1rem 2rem;
}

/* Images */
figure {
    margin: 0;
    padding: 0;
}

figure img {
    max-width: 100%;
}

figure figcaption {
    color: var(--color-text-secondary);
}

/* Forms */

button:disabled,
input:disabled {
    background: var(--color-bg-secondary);
    border-color: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    cursor: not-allowed;
}

button[disabled]:hover {
    filter: none;
}

form {
    border: 1px solid var(--color-bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow) var(--color-shadow);
    display: block;
    max-width: var(--width-card-wide);
    min-width: var(--width-card);
    padding: 1.5rem;
    text-align: var(--justify-normal);
}

form header {
    margin: 1.5rem 0;
    padding: 1.5rem 0;
}

input,
label,
select,
textarea {
    display: block;
    font-size: inherit;
    max-width: var(--width-card-wide);
}

input[type="checkbox"],
input[type="radio"] {
    display: inline-block;
}

input[type="checkbox"]+label,
input[type="radio"]+label {
    display: inline-block;
    font-weight: normal;
    position: relative;
    top: 1px;
}

input,
select,
textarea {
    border: 1px solid var(--color-bg-secondary);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    padding: 0.4rem 0.8rem;
}

input[readonly],
textarea[readonly] {
    background-color: var(--color-bg-secondary);
}

label {
    font-weight: bold;
    margin-bottom: 0.2rem;
}

/* Tables */
table {
    border: 1px solid var(--color-bg-secondary);
    border-radius: var(--border-radius);
    border-spacing: 0;
    display: inline-block;
    max-width: 100%;
    overflow-x: auto;
    padding: 0;
    white-space: nowrap;
}

table td,
table th,
table tr {
    padding: 0.4rem 0.8rem;
    text-align: var(--justify-important);
}

table thead {
    background-color: var(--color);
    border-collapse: collapse;
    border-radius: var(--border-radius);
    color: var(--color-bg);
    margin: 0;
    padding: 0;
}

table thead th:first-child {
    border-top-left-radius: var(--border-radius);
}

table thead th:last-child {
    border-top-right-radius: var(--border-radius);
}

table thead th:first-child,
table tr td:first-child {
    text-align: var(--justify-normal);
}

table tr:nth-child(even) {
    background-color: var(--color-accent);
}

/* Quotes */
blockquote {
    display: block;
    font-size: x-large;
    line-height: var(--line-height);
    margin: 1rem auto;
    max-width: var(--width-card-medium);
    padding: 1.5rem 1rem;
    text-align: var(--justify-important);
}

blockquote footer {
    color: var(--color-text-secondary);
    display: block;
    font-size: small;
    line-height: var(--line-height);
    padding: 1.5rem 0;
}

css는 좋은 아져씨꺼 사용하였다

 

<!DOCTYPE html>
<html>

<head>
	<title>
    Nomad News |
    
      Popular
    
  </title>
  <link href="https://andybrewer.github.io/mvp/mvp.css" rel="stylesheet"></link>
</head>

<body>
  <header>
    <h1>Nomad News</h1>
    {% if order == "popular"%}
    <div>
      Order by:
      
        <strong>Popular</strong>
      
      |
      
        <a href="/?order_by=new">New</a>
      
    </div>
    {% elif order == "new"%}
    <div>
      Order by:
      
        <a href="/?order_by=popular">Popular</a>
      
      |
        
        <strong>New</strong>
      
    </div>
    {% else %}
    <div>
      Order by:
      
        <strong>Popular</strong>
      
      |
      
        <a href="/?order_by=new">New</a>
      
    </div>
    
    {% endif %}
  </header>
  <main>
    {% for i in data%}
      <div>
        <div>
          <a href="{{i["objectID"]}}">
            <h3>
              {{i["title"]}}
            </h3>
          </a> 
          (<a href="{{i["url"]}}" target="blanl">{{i["url"]}}
          </a>)
        </div>
        <div>
          {{i["points"]}} points | By: {{i["author"]}} | {{i["num_comments"]}} comments
        </div>
      </div>
      <hr />
    {% endfor %}

  </main>
</body>

</html>

메인 html이라고 볼수 있다

<!DOCTYPE html>
<html>

<head>
	<title>
    Nomad News | Steve Jobs has passed away.
  </title>
  <link href="https://andybrewer.github.io/mvp/mvp.css" rel="stylesheet"></link>
</head>

<body>
  <header>
    <h1>{{data['title']}}</h1>
    <div>
      {{data['points']}} points | By {{data['author']}} | <a href="{{data['url']}}" target="_blank">{{data['url']}}</a>
    </div>
  </header>
  <main>
    {% for i in data['children']%}
      <div>
          <strong>{{i['author']}}:</strong>
          <p type="html">{{i['text']|safe}}</p>        
      </div>
      <hr />
    {% endfor %}    
  </main>
</body>

</html>

서브 html이라고 볼수 있다

이번꺼는 잘 넘어갔고 

html에 값을 넘기는 방법과 파이썬으로 사용하는 방법 이용하여 만들면 좋다~!

블로그 이미지

Or71nH

,

###단축키

str = "" + 문자열    두 문자열을 합쳐 넣어준다
"{0} 에서 {1}까지".format(문자열, 문자열)    문자를  대입하여 넣어준다
print("-"*13, end="") 원래 마즈막은 \n 마즈막을 바꾸어 줄바꿈이 없이 출력
print("'{0}'".format(data_str[start: end]))   출력할 부분 출력
len(data_str)   문자열 길이를 알려줌
data_str.find("찾을 문자")   문자를 찾아 시작위치를 출력한다
data_str.rfind("찾을 문자:)   문자를 찾아 끝위치를 출력한다
idx = data_str.index(input_str)   위와 같지만 에러가 발생한다
"사이사이 추가할 거 ".join(data_str)   한 문자마다 사이에 추가해준다
capiralize() lower() upper()   대소문자 만들기 함수
lstrip() rstrip() strip()   양쪽만 없에는 그런 함수
replace("찾을거", "변환할거")   찾은것을 모두 변환한다
split("찾을 문자")   입력 문자 기준으로 나누어 준다
"문자".isdigit()   숫자 문자열인 경우 true 반환

### 거꾸로 출력하기

idx = -1
while true:
	print("data_str[{0}] : {1}".format(idx, data_str[idx]))
    if idx == -cnt:
    	break
        idx -= 1

### 문자열 특정 부분 출력

data_str = "와우! 안녕하세요, 파이썬입니다."

start = input("시작 인덱스를 입력하세요: ")
end = input("종료 인덱스를 입력하세요: ")

try
	end = int(end)
except ValueError:
	end = None
    
print("'{0}'".format(data_str[start: end]))

// 숫자를 넣으면 사이값을 출력

###갯수알아내기

data_str = "Have a nice day!"

print("'{0}'".format(data_str))
input_str = input("위에서 찾고자 하는 문자열을 입력하세요: ")

print("'{0}'에서 '{1}'은 {2} 번 나타납니다.".format(data_str, input_str, data_str.count(input_str)))

### 찾고자 하는 문자열 

data_str = "파이썬은 클래스를 이용해 객체를 생성하는 갯체지향 프로그래밍 언어입니다."

print("'{0}'".format(data_str))
input_str = input("위에서 찾고자하는 문자열을 입력하세요: ")

print("str.find() ...")
idx = data_str.find(input_str)

if idx != -1:
	print("\t'{0}' : [{1}] <= 문자열을 가장 먼저 찾은 위치".format(input_str, idx))
else:
	print("\t'{0}'를 찾을 수 없습니다.".format(input_str))
    
print("str.rfind() ...")
idx = data_str.rfind(inpur_str)

if idx != -1:
	print("\t'{0}' : [{1}] <= 문자열을 가장 마즈막 찾은 위치".format(input_str, idx))
else:
	print("\t'{0}'를 찾을 수 없습니다.".format(input_str))
    
print("str.index() ...")
try:
	idx = data_str.index(input_str)
    print("\t'{0}' : [{1}] <= 문자열을 가장 먼저 찾은 위치".format(input_str, idx))
except ValueError:
	print("\t'{0}'를 찾을 수 없습니다.".format(input_str))

### join()

data_str ="가나다라마바사아자차카타파하"
comma_space = ", "

output = comma_space.join(data_str)
print("{-}: {1}".format(type(output), output))

### capiralize() lower() upper()

data_str = "better tomorrow"

data_str = data_str.capitalize()
print("'{0}'".format(data_str_))
 // 맨앞만 대문자로함

data_str = data_str.lower()

// 모든 문자 소문자로 변환

data_str = data_str.upper()

//모든 문자 소문자로 변환

###lstrip() rstrip() strip()

data_str = " 홍 길동 "
data_str = data_str.lstrip(" ")
print("'{0}' : ({1})".format(data_str, len(data_str)))

/// 왼쪽에서 다른거 나올때 까지 제거 


data_str = "___홍  길 동______  "
data_str = data_Str.rstrip("_ ")
print("'{0}' : ({1})".format(data_str, len(data_str)))

//오른쪽에서 따른거 나올때 까지 제거

data_str = " 0?홍  길동  _#     "
data_str = data_Str.strip(" 0?_#")
print("'{0}' : ({1})".format(data_str, len(data_str)))

/// 양쪽에서 다른거 나올떄까지 제거한다

### replace ()

data_str = "10....20.....30.....40.....50"

data_str =data_str.replace("."*4, "\t")
print(data_str)



data_str = "10, 20, 30, 40, 50"

data_str = data_str.replace(" ","")
print(data_str)

data_list = data_str.split(",")
for val in data_list:
	print(val)

### split()

data_str = "10, 20, 30, 40, 50"

data_str = data_str.replace(" ","")
print(data_str)

data_list = data_str.split(",")
for val in data_list:
	print(val)

 

###문자열 구성 확인 방법 isdigit():

data_str = "10, 20, 3o, 40 ,50"

data_str = data_str.replace(" ", "")
print(data_str)

data_list = data_str.split(",")
for val in data_list:
	print(val, end=" ")
    if not val.isdigit():
    	print("<= ", end="")
    print()

 

# -*- coding: utf8 -*-

data_str = " 파이썬은 클래스를 이용해 객체를 생성하는 객체지향 프로그래밍 언어입니다."

find_str = "객체"

===============(문자 하나 찾기)==================================
idx = data_str.find(find_str, 15) /// find("찾을문자" , 시작위치)

print(idx)
==========(문자 모두다 찾기)========================
idx = -1 

count = 1
while True: 
	idx = data_str.find(find_str, idx + 1 )
    if idx != -1:
    	print("[0] ~[1]".format(idx, idx + len(find_str) -1))
        new_str = data_str.replace(find_str,"****", 1)replace("문자열","변환할거",몇번할것인지)
        print(new_str)
        count += 1
    else:
    	break
        
 =======================================

'+++++SW 일일 공부+++++ > SW Expert Aademy' 카테고리의 다른 글

stack  (0) 2020.03.26
객체지향  (0) 2020.02.11
Python Dict()  (0) 2020.02.02
파이썬 set(), 집합  (0) 2020.02.02
파이썬 받은 값 문자열 정렬 영어사전만들기  (0) 2020.02.02
블로그 이미지

Or71nH

,

###set

data_set = {..., ..., ..., ...} 넣고 싶은 값  중복을 재거하여 담는다
type(data_set) <class 'set'> 데이터 타입을 출력한다
set1 & set2 intersection 과 같음 같은 값을 출력한다
set1 | set2 union 과 같음 모든 값을 하나씩 출력한다
set1 - set2 difference와 같음 중복된 값을 빼고 출력한다
data_set.add(값)   값을 추가함 중복시 추가안함
data_set.update({값,값,값})   여러개의 값을 추가함
data_set.remove(값) 제거할 값 값을 찾아 제거함
data_set.pop(위치) 제거할 위치 위치를 찾아 제거함
data_set.clear()   다제거함
값 in data_set 값이 있으면 값이 있으면 True
값 not in data_set 값이 없으면 값이 없으면 True
data_set.issuperset(셋) 셋 객체  셋 을 전부 포함하고 있는지 True
data_set.issubset(셋) 셋 객체 셋에 전부 포합되어 있는지 True
enumerate(data_set)   위치와 값을 2개 반환함
     
     

### set

data_set = {10, 20, "파이썬", "파이썬"}

print("{0} {1}".format(type(data_set), data_set))

data_set = set(range(10,21,2))
print("{0} {1}".format(type(data_set), data_set))

data_str = "Better Tommorrow"
data_set = set(data_str)
print("{0} {1}".format(type(data_set), data_set))

### 집합 

data_set1 = {1, 2, 2, 3, 4, 4, 5, 6, 7, 7, 7, 11}
data_set2 = {2, 3, 5, 9, 11, 12, 15]

print("{0} & {1} = {2}".format(data_set1, data_set2, data_set1 & data_set2))
print("{0} | {1} = {2}".format(data_set1, data_set2, data_set1 | data_set2))
print("{0} - {1} = {2}".format(data_set1, data_set2, data_set1 - data_set2))

print("{0}.intersection({1}) = {2}".format(data_set1, data_set2, data_set1.intersection(data_set2)))
print("{0}.union({1}) = {2}".format(data_set1, data_set2, data_set1.union(data_set2)))
print("{0}.difference({1}) = {2}".format(data_set1, data_set2, data_set1.difference(data_set2)))

### set 활용하기

data_set1 = {1, 2, 2, 3, 4, 4, 5, 6, 7, 7, 7, 11}0

data_set2 = {x for x in data_set1}
print("data_set2: {0} {1}".format(type(data_set2), data_set2))

data_set3 = {x for x in data_set1 if item %  2 == 1}
print("data_set3: {0} {1}".format(type(data_set3), data_set3))

data_set4 = {x for x in data_set1 if item % 2 == 0 }
print("data_set4: {0} {1}".format(type(data_set4), data_set4))

data_set5 = {x * y for x in data_set1 if x % 2 == 1
					for y in data_set1 if y %2 == 0}
print("data_set5: {0} {1}".format(type(data_set5), data_set5))

 

블로그 이미지

Or71nH

,

###단축키

data_typle = (..., ..., ...)   리스트와 다르게 변화할 수 없는 변수 만듬
tuple(...)   입력된 내용을 튜플로 변환함
tuple[-숫자] 숫자는 1부터 뒤에서부터 시작한다
tuple[숫자1:숫자2+1] 숫자1 시작 숫자2 끝 시작 값 부터 끝값까지 나열한다
tuple.index(값) 값 찾을값 값에 맞는 위치를 돌려준다
hex(id(data_tuple)) 주소찾을 tuple 튜플의 주소를 16진수로 반환한다
tuple1, tuple2 = (10, 20, 30), (40, 50)   튜플 다중 생성
값 in data_tuple 찾을값 있으면 ture 없으면 false
값 not in data_tuple   있으면 false 없으면 ture 
data_tuple.count(값) 갯수를 알려줌 같은값의 갯수를 알려줌
tuple(range(시작,끝+1,범위)   배열 반복함수로 만들기
tuple_G = item for item in data_tuple 안애 속성을 모조리 가져옴 안에 있는 속성을 모두 출력함
상위 tuple(tuple_G)   온전한 튜플로 돌아옴

### tuple()

data_tuple = (10,21.5, "파이썬:, True)

print("{0} {1}".format(type(data_tuple), data_tuple))

data_tuple = tuple(range(10, 21, 2))
print("{0} {1}".format(type(data_tuple), data_tuple))

data_str = "안녕하세요"
data_tuple = tuple(data_str)
print("{0} {1}".format(type(data_tuple), data_tuple))

### tuple()

data_tuple = [10, 20, 30, 40, 50]

print("data_tuple: {0}".format(data_tuple))


print("data_tuple[0]: {0}".format(data_tuple[0]))
print("data_tuple[1]: {0}".format(data_tuple[1]))
print("data_tuple[2]: {0}".format(data_tuple[2]))
print("data_tuple[3]: {0}".format(data_tuple[3]))
print("data_tuple[4]: {0}".format(data_tuple[4]))

### 학점 구조 만들기

# -*- coding: utf-8 -*-

# 학점.py

scores = []

count = int(input("총 학생 수를 입력하세요: "))

for i in range(1, count + 1):
	score = []
    kor = int(input("학생{0}의 국어 점수를 입력하세요: ".format(i)))
    socre.append(kor)
    mat = int(input("학생{0}의 수학 점수를 입력하세요: ".format(i)))
    score.append(mat)
    eng = int(input("학생{0}의 영어 점수를 입력하세요: ".format(i)))
    score.append(eng)
    scores.append(score)
    
for i, score inenumerate(socres):
	total = 0 
    for s in score:
    	total += s
    print("학생{0} => 총점: {1}, 평균: {2:0.2F}".format(i, total, total / len(score)))
블로그 이미지

Or71nH

,