TIL/202103

210323 TIL

벽을넘다 2021. 3. 24. 14:26

 

1.English (수동태)

No equipment is required to do that. 

Meditation can be done by breathing and feeling the natural surroundings, which can make me feel better and improve my 

body status as well

 

2.reading

Sweden’s value regarding labor. We need to consider of ‘decommodification’(탈상품화)

 

3.datacamp

referencial integrity(참조 무결성)

set a relationship between table A and B

we can use some ways about deleting condition.

cascade(delete when table B was deleted at the same time), set null(get specific value null)

4.algorithm (파이써닉한 코드)

main instances of input

int, str, list

 

num = int(input())

string = input()

char_lst = list(input())

 

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

 

It is important to make a base code line like a psedo-code

After that, the specific structure can be made and modified. 

 

change what I code to be simpler.

 

# A case of multiple loops



for i in range(N):

for j in range(N):

for k in range(N):



# —>



for num in range(N**3):

i, j, k = num // (N*N), num// N % N, num % N



# the smaller indent, the better readable



# example



for i in range(N):

if state:

process()



# —>



for i in range(N):

if not state : continue # go back to the beginning

process()





# we don’t always need to use ‘else’ 



# not efficient



def function(x):

if x :

return True

else:

return False



# recommendations 

def function2(x):

if x : return True

return False



def function3(X):

return True if x else False

 

-how to make variables (변수 만드는 방법)