GentBG - why bother to burn STEEM?

Image
by joviansummer original STEEMIT post: https://steemit.com/blog/@joviansummer/gentbg-why-bother-to-burn-steem GentBG - a new experiment to burn STEEM Hello, this is @joviansummer(witness: @jswit). I'd like to briefly explain why I bothered to start @gentbg experiment. Unlike bitcoin, STEEM has no supply limit. As long as STEEM exists, newly minted STEEM will be added to total supply. If we can't maintain corresponding demand or reduce supply, downward pressure on STEEM price can be a big challenge. @gentbg project is an experiment to reduce STEEM supply by burning. @gentbg will burn liquid author reward and delegate SP reward to @jsup to get amplified upvotes. The main purpose is to create a perpetual STEEM burning loop. I added a bit of fun factor via AI-generated images, to incentivize giving upvotes to @gentbg's posts. If you have some spare voting power, you can contribute to burning STEEM by giving upvotes to @gentbg's posts. Initial run of this experiment wil...

파이썬에서 문자열의 일부를 가져오기

by joviansummer
original STEEMIT post: https://steemit.com/blog/@joviansummer/1tuzx


파이썬에서 문자열을 사용할 때 특정 위치의 글자들을 편리하게 가져올 수 있습니다.

x = 'hello world'

위와 같이 x에 문자열 'hello world'를 할당해 주었습니다. 첫번째 글자, 두번째 글자 등 특정 위치의 글자 하나를 가져오려면 아래의 예시처럼 할 수 있습니다.

# 문자열 x의 첫번째 글자 출력
print(x[0])

h

x[0]이 첫번째 글자인 'h', x[1]이 두번째 글자인 'e'가 됩니다.

범위를 지정할 수도 있습니다. 만약 첫번째부터 세번째 글자까지 가져오고 싶다면 x[0:3] 이렇게 설정합니다.

# 문자열 x의 첫번째부터 세번째 글자까지 출력
print(x[0:3])

hel

유의할 점은, 위치가 0부터 시작하고, 콜론(:) 다음에 지정되는 인덱스값은 출력값에 포함되지 않는다는 점입니다. x[0:3]이면 x[0]부터 x[2]까지 가져오는 것입니다.

특정 위치부터 마지막까지 가져올 수도 있습니다. 끝나는 위치를 지정하지 않으면 됩니다.

# 2번째 글자부터 끝까지 출력
print(x[1:])

ello world

Comments

Popular posts from this blog

스티미언의 영향력 지수 계산

jsup/avle code update - you don't have to write post everyday

jsup/avle 보팅 코드 갱신 - 1일1포스팅 강박에서 벗어나기