HR파이썬 Lists

개요[ | ]

HR파이썬 Lists
해커랭크 Python
# 문제 비고
HR파이썬 Basic Data Types e
8 HR파이썬 List Comprehensions
9 HR파이썬 Find the Runner-Up Score!
10 HR파이썬 Nested Lists
11 HR파이썬 Finding the percentage
12 HR파이썬 Lists
13 HR파이썬 Tuples

if __name__ == '__main__':
    N = int(input())
    lst = []
    for _ in range(N):
        command, *params = input().split()
        if command == 'insert':
            i, e = map(int,params)
            lst.insert(i, e)
            continue
        if command == 'print':
            print( lst )
            continue
        if command == 'remove':
            e = int(params[0])
            lst.remove(e)
            continue
        if command == 'append':
            e = int(params[0])
            lst.append(e)
            continue
        if command == 'sort':
            lst.sort()
            continue
        if command == 'pop':
            lst.pop()
            continue
        if command == 'reverse':
            lst.reverse()
            continue
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}