0w0

[BASIC] 파이썬 연산자 본문

Coding/Python

[BASIC] 파이썬 연산자

0w0 2020. 11. 16. 03:18
728x90
반응형
#연산자

print(1+1) #귀요미아님 :)
print(5-2)
print(5*3)
print(5/2)

print()

print(2**3) #**:제곱^
print(8%3)  #%:나머지
print(4//3) #//:몫

print()

print(7>3) #True
print(4>=2) #True
print(5>=8) #False
print(7<=9) #True
print(9<=4) #False

print()

print(21==21) #True
print(7==3) #False
print(10+11==21) #True


print("=========================")

print("1. not")
print(2!=9) #True
print(not(2!=9)) #False

print("\n2. and,&") #and,&
print((5>3) and (3<5)) #True
print((5>3) & (3<5)) #True

print("\n3. or,|") #or,|
print((7>5) or (7<3)) #True
print((7>5) | (7<3)) #True

print("\n4. 연속등호")
print(7>5>3>1) #True
print(7>2>3) #False


#출력형태
C:\Users\hotsk\Anaconda3\envs\Repeat\python.exe C:/Workspace/repeat/helloworld.py
2
3
15
2.5

8
2
1

True
True
False
True
False

True
False
True
=========================
1. not
True
False

2. and,&
True
True

3. or,|
True
True

4. 연속등호
True
False

Process finished with exit code 0

 

728x90
반응형
Comments