Python

30 Days Challenge 1일차
i = 4 d = 4.0 s = 'HackerRank ' # Declare second integer, double, and String variables. # Read and save an integer, double, and String to your variables. # Print the sum of both integer variables on a new line. # Print the sum of the double variables on a new line. # Concatenate and print the String variables on a new line # The 's' variable above should be printed first. 이렇게만 주어진 상태에서 12 4.0 is..

HackerRank Challenge 3일차
#!/bin/python3 import math import os import random import re import sys # Complete the compareTriplets function below. def compareTriplets(a, b): if __name__ == '__main__': fptr = open(os.environ['OUTPUT_PATH'], 'w') a = list(map(int, input().rstrip().split())) b = list(map(int, input().rstrip().split())) result = compareTriplets(a, b) fptr.write(' '.join(map(str, result))) fptr.write('\n') fptr..

파이썬 가지고 놀기 (2)
부울 대수 대표적으로 부울대수는 AND OR NOT이 있다. A B A AND B T T T T F F F T F F F F 이게 AND 연산의 테이블이다. AND 연산은 A와 B 모두가 참일 때만 참이다. A B A OR B T T T T F T F T T F F F 이게 OR 연산의 테이블이다. OR 연산은 A와 B 둘중에 하나만 참이어도 참이다. A NOT A T F F T 이게 NOT 연산의 테이블이다. '참' 을 '거짓'으로 '거짓'을 참으로 바꾼다. 기본 개념은 이정도로 하고 파이썬 코드로 좀 더 알아보자. print(2 > 1) # True를 출력, 2는 1보다 크다는 맞는 말이므로 print(2 = 2) #..

python 완전 기초
python 필수 설치프로그램 구글 검색창에서 python을 검색해서 상단에 Welcome to python.org 라고 써있는 링크를 클릭하고 해당 사이트에서 Downloads를 클릭하고 설치합니다. 설치창에서 체크박스는 전부 체크해주세요. (지금 설치한 것이 python interpreter로 python코드를 컴퓨터가 읽을 수 있는 언어로 바꿈) 구글에서 pycharm을 검색해서 www.jetbrains.com이라는 사이트에서 우측 상단 downloads 클릭하고 professional 과 community 중에 community로 설치 (pycharm은 python의 통합개발환경(IDE) ) 실행은 pycharm으로 실행 pycharm 환경 구성 실행 후 new project 누름 경로 밑에 ▶p..