#숫자형 사칙연산
a = 15
b = 2

print(a + b)
print(a - b)
print(a * b) #곱하기
print(a / b) #나누기
print(a // b) #몫
print(a % b) #나머지

print('------예제1-----')
num1 = 12
num2 = num1 + 10
answer = num2 /2
print(num2)
print(answer)

#문자열 연산
print('-----문자열 연산-----')
text1 = '안녕'
text2 = '하세요'

print(text1 + text2) #문자열에는 문자열만 더할 수 있다
print(text1 * 3) #문자열에는 정수만 곱할 수 있다
print(4 * text2) #곱하기 순서는 상관없다

print(text1 + '2')

print('------예제2-----')
text3 = "Wow"
print(text3 + "!!!")

text3 = "Wow"
text4 = '!!!'
print(text3 + text4)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: