jsup 2.1 - investor's relief (experiment on separation of investment and SNS)

by joviansummer original STEEMIT post: https://steemit.com/blog/@joviansummer/jsup-2-1-investor-s-relief-experiment-on-separation-of-investment-and-sns Hello, this is @joviansummer(witness: @jswit). I'm starting a new experiment regarding my @jsup vote service. The purpose of this experiment is to separate STEEM investment and social interaction(posting/commenting). For many people, writing a post daily(literally 365 posts per year) is not easy. It's not fun, and mandatory daily post only written for self-voting delegation service tends to result in useless low-quality content. I hope this new function of @jsup will reduce those posts, and also make it a bit more easy to invest in STEEM without worrying about daily posting. I think pressure of daily posting significantly undermines Steem as SNS. It's not fun. This is how it works: From 11:45 PM to 11:50 PM every night(reference time zone is GMT+9), @jsup checks if eligible delegators wrote something and received daily v...

파이썬에서 리스트(list) 정렬(sort)

by joviansummer
original STEEMIT post: https://steemit.com/blog/@joviansummer/list-sort


sorted() 함수를 이용해서 리스트에 담긴 값들을 정렬할 수 있습니다.

x = [1, 3, 5, -1, 0]

# x의 값을 오름차순으로 정렬하여 x_sorted에 할당
x_sorted = sorted(x)

결과값을 비교하면 아래와 같습니다.

print(x) [1, 3, 5, -1, 0]

print(x_sorted) [-1, 0, 1, 3, 5]

반대로 내림차순 정렬을 하려면 아래와 같이 합니다.

# x의 값을 내림차순으로 정렬하여 x_sorted_rev에 할당
x_sorted_rev = sorted(x, reverse=True)

print(x_sorted_rev)

[5, 3, 1, 0, -1]

리스트에 문자열을 저장했을 경우에도 정렬이 됩니다.

y = ['xyz', 'def', 'abc']
y_sorted = sorted(y)

print(y_sorted) ['abc', 'def', 'xyz']

한가지 생각할 점은, 리스트에 담긴 값들이 같은 종류의 값이어야 한다는 점입니다. 예를 들어 문자열(string)과 정수(int)가 혼합된 리스트에서는 sorted() 함수를 사용하지 못합니다.

Comments

Popular posts from this blog

GentBG - why bother to burn STEEM?

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

jsup.GEN - working on image-to-image generation with AI