편집 기록

편집 기록
  • 프로필 엽토군님의 편집
    날짜2021.11.28

    코딩초보 리스트슬라이스도 루프돌릴수있는지 질문드립니다.


    맨 아래에 있는 리스트 합본을 5개씩 잘라서 출력을하고싶은데 혹시 리스트 슬라이스 범위도 루프로 만들어서 자동으로 만들어지게끔 할수 있을까요???

    num = int(input())
    moc = num//4
    namu = num%4
    like = 0
    hell = 0
    a = []
    
    while like < moc:
        like = like + 1    
        hell = like    
        print(hell)    
        b=[]    
        b.append(hell)
    
        while hell < num:    
            hell = hell + moc    
            if hell > (num-namu): continue    
            print(hell)    
            b.append(hell)
    
        a.append(b)
    
    hell = num - namu
    b=[]
    c=[]
    
    while hell < num:
        hell = hell + 1    
        print(hell)    
        b.append(hell)
    
    c.append(b)
    
    # 문제의 "리스트 합본"
    d=a[0:5]
    print(d)
    d=a[6:10]
    print(d)
    print(c)
    
  • 프로필 초보자님의 편집
    날짜2021.11.28

    코딩초보 리스트슬라이스도 루프돌릴수있는지 질문드립니다.


    맨 아래에 있는 굵은글씨 리스트 합본을 5개씩 잘라서 출력을하고싶은데 혹시 리스트 슬라이스 범위도 루프로 만들어서 자동으로 만들어지게끔 할수 있을까요???

    num = int(input())
    
    moc = num//4
    
    namu = num%4
    
    like = 0
    
    hell = 0
    
    a = []
    
    
    while like < moc:
    
        like = like + 1
    
        hell = like
    
        print(hell)
    
        b=[]
    
        b.append(hell)
    
        while hell < num:
    
            hell = hell + moc
    
            if hell > (num-namu): continue
    
            print(hell)
    
            b.append(hell)
    
        a.append(b)
    
    
    
    hell = num - namu
    
    b=[]
    
    c=[]
    
    while hell < num:
    
        hell = hell + 1
    
        print(hell)
    
        b.append(hell)
    
    
    c.append(b)
    
    **d=a[0:5]**
    
    **print(d)**
    
    **d=a[6:10]**
    
    **print(d)**
    
    print(c)
    
  • 프로필 안강민님의 편집
    날짜2021.11.26

    코딩초보 리스트슬라이스도 루프돌릴수있는지 질문드립니다.


    맨 아래에 있는 굵은글씨 리스트 합본을 5개씩 잘라서 출력을하고싶은데 혹시 리스트 슬라이스 범위도 루프로 만들어서 자동으로 만들어지게끔 할수 있을까요???

    num = int(input())

    moc = num//4

    namu = num%4

    like = 0

    hell = 0

    a = []

    while like < moc:

    like = like + 1
    
    hell = like
    
    print(hell)
    
    b=[]
    
    b.append(hell)
    
    while hell < num:
    
        hell = hell + moc
    
        if hell > (num-namu): continue
    
        print(hell)
    
        b.append(hell)
    
    a.append(b)
    

    hell = num - namu

    b=[]

    c=[]

    while hell < num:

    hell = hell + 1
    
    print(hell)
    
    b.append(hell)
    

    c.append(b)

    d=a[0:5]

    print(d)

    d=a[6:10]

    print(d)

    print(c)