#파이썬입니다.
'''
이 글자들은 모두 주석처리입니다.
'''
"""
이 글자들 또한 모두 주석처리입니다.
"""
print("hello world!")
#자료형
2 #정수형
0.8 #실수형
"문자"
'문자'
"1234" #문자열
[1, 3, 4, 6] #리스트
#변수 - 데이터를 저장할 수 있는 공간 (변하는 수)
age = 14
name = '김알고'
print(age)
print(name)
age = 15
print(age)
print(3+5)
print(5-1)
print(10*2)
print(10/5)
print(10%3)

num = 10
print(num + 10)

num1 = 12
num2 = num1 + 10
answer = num2 / 2
print(answer)

print(2**5) #제곱
print(13//5) #몫

ans1 = 3 % 2
ans2 = 2 ** 4
print(ans1, ans2)

print('안녕' + '하세요')
print('안녕' * 3)

str1 = '덩덕' + '쿵덕'
str2 = '쿵덕' * 2
jajinmori = str1+str2+str1*2
print(jajinmori)

a = "abcdef"
b = [40, 30, 20, 50, 100]
#인덱스 - 원소의 번호 (0부터 시작)
#인덱싱 - 인덱스를 이용해서 원소를 찾아내는 것
print(b[0]) 
print(a[2])
print([1, 2, 3][1])
print('apple'[4])

animal = ['토끼', '멜론', '공작새']
animal[1] = '사자'
print(animal)

#슬라이싱(slicing) - 일정 범위의 원소만 잘라서 가져옴
numbers = [2, 4, 6, 8, 10, 12, 14]
print(numbers[2:5]) 

c = 18
f = c * (9/5) + 35
print(f)

#입력 함수
var = input()
print(var)

#type 함수 - 자료형을 알려주는 함수
print(type('3.14')) #결과: <class 'str'>

'''
구분   이름     함수
정수   integer  int()
실수   float    float()
문자열 string   str()
리스트 list     list()
'''

a = '345'
print(type(a))
b = int('345')
print(type(b))

money = input()
money = int(money)
print(money * 2)









Embed on website

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