입문 글
https://docs.google.com/document/d/18CPaWRShjYaA9WQhdObkw7DQMqLUJSwhQwB8YJ5FzJk/edit?usp=sharing
자바는 script 안에 들어가야함
파이썬은 print(항목)
console.log(1) 콘솔창에만 나오긴함
<->print(1)
console.log(1);
console.log(1.2);
console.log(1+1);
console.log(2-1);
console.log(2*2);
console.log(6/2);
console.log(Math.pow(3,2));
console.log(Math.random);
<->
print(1)
print(1.1)
print(1+1)
print(2-1)
print(2*2)
print(6/2)
print(3**2)
print(pow(3,2))
import random
print(random.random())
console.log('hello')
console.log("hello")
console.log(`hello
world
`)
console.log('hello'.length)
console.log('hell world'.replace('hell','hello'))
<->
print('hello')
print("hello")
print('''
hello
World
''')
print(len('hello'))
'hell, world!'.replace('hell', 'hello')
print('hell world'.replace('hell','hello'))
JAVA에서는 `(tap위)으로 여러줄 표현, Python에서는 '''(작은따옴표)으로 표현
let member = ['egoing','duru','taeho']
console.log(member[0])
<->
member = ['egoing','duru','taeho']
print(member[0])
갯수 구하기 print(len(member))
랜덤으로 고르기
import random
print(random.choice(member))
배열에서의 합
score = [100,200,300,400]
print(sum(score))
let 가격 = 10000;
let 부가가치세율 = 0.1;
let 부가가치세 = 가격*부가가치세율;
console.log(부가가치세);
<->
name = '이고잉'
print('안녕하세요.'+name+'님, ....이고잉....안녕히계세요.'+name+'님')
name = '이고잉'
print(f'안녕하세요.{name}님, ....이고잉....안녕히계세요.{name}님')
let input_id = prompt('id?');
//만약에 input_id가 egoing과 같다면 아래 코드 실행
if(input_id==='egoing'){
alert(input_id+'님 안녕하세요^^');
} else{
alert(input_id+'님 누구세요?');
<->
갯수 = float(input('몇개?')) ----------입력값 받아서 출력하는 것
부가세율 = (14-205/30)
부가세 = 갯수*부가세율*0.95
print(부가세)
h1>a{text-decoration: none} h1의 직계a만 적용
pow() 제곱, 내장함수
차이점을 구별하는것이 어려웠음
알게된 사이트
https://ideone.com/
https://seomal.com/map/1/30 들어볼것
파이썬이 손이 덜 바쁠것 같아서 좋다