본문 바로가기
[Python & Ruby]

[Python & Ruby] Variable

by Hevton 2020. 12. 11.
반응형

Python :

x=10
y=5
print(x+y)
 
title = "python & ruby"
print("Title is "+title)

 

Ruby :

x=10
y=5
puts(x+y)
 
title = "python & ruby"
puts("Title is "+title)

 

 

Output :

15
Title is python & ruby

 

알게 된 내용 :

파이썬과 루비는 자바스크립트에서처럼 자료형을 생략해도 됨 (자바스크립트에서는 var을 붙여주는게 좋긴 함)

반응형

'[Python & Ruby]' 카테고리의 다른 글

[Python & Ruby] IO  (0) 2020.12.11
[Python & Ruby] 조건문 (Conditional Statement)  (0) 2020.12.11
[Python & Ruby] STRING  (0) 2020.12.10
[Python & Ruby] Hello World!  (0) 2020.12.10
[Python] Python3 설치  (0) 2020.12.10