GithubHelp home page GithubHelp logo

algo-python's Introduction

Algo-Python

I LOVE PYTHON. 올 겨울 진정한 Python Lover가 되고자 하는 여정 중 하나.

🙆‍♂️ 빠른 입력

import sys
input = sys.stdin.readline
# sys를 import하고 imput이 들어갈 자리에 sys.stdin.readline을 입력

🙆‍♂️ 1개 값 입력

🚀 문자열 입력

a = input()

🚀 정수형 입력

a = int(input())

🙆‍♂️ 띄어쓰기로 구분되는 2개 값 입력

🚀 문자열 입력

a,b = input().split()

🚀 정수형 입력

a,b = map(int, input().split())

🙆‍♂️ 여러 개 값을 일차원 배열로 입력

🚀 정수형 입력 (띄어쓰기로 구분)

arr = list(map(int,input().split()))

🚀 정수형 입력 (띄어쓰기로 구분)

arr = []
for i in range(n):
	arr.append(int(input()))

# n 값도 함께 입력받을 때 사용.

🚀 정수형 입력 (엔터로 구분)

arr = [int(input()) for _ in range(n)]
# n값이 엔터 횟수가 되야한다.

🚀 문자열 입력 (엔터로 구분)

arr = [input() for _ in range(i)]
# 배열 속에 문자열 하나하나가 값으로 입력된다.

🙆‍♂️ 여러 개 값을 이차원 배열로 입력

🚀 띄어쓰기 구분 X (한 숫자 다 값으로)

arr = [list(map(int,input())) for _ in range(n)]
# int로 매핑한 것을 뺀다면 문자도 가능.

🚀 띄어쓰기로 구분 O

arr = [list(map(int,input().split())) for _ in range(n)]

🙆‍♂️ 정수를 배열로

num = 12345
arr = list(map(int,str(num)))
 >> [1,2,3,4,5]

algo-python's People

Contributors

daeell avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.