source Code
Python | py_basic_week1
- py_basic_week1 [ 튜플 / 집합 / f-string / 예외처리 / 파일분리 / map,lambda,filter / class ] 1. [set.py] student_a = ['물리2','국어','수학1','음악','화학1','화학2','체육'] student_b = ['물리1','수학1','미술','화학2','체육'] set_a = set(student_a) set_b = set(student_b) print(set_a - set_b) 2. [f_string.py] scores = [ {'name':'영수','score':70}, {'name':'영희','score':65}, {'name':'기찬','score':75}, {'name':'희수','score':23}, {'name':'서..
BAE/<JOON> | 입력과 사칙연산
1. [특수기호 출력] print("\'") print('\"') print('\\') 2. [사칙연산] 무조건 int형 선언 a,b = map(int, input().split()) print(a+b) 3. [킹, 퀸, 룩, 비숍, 나이트, 폰] a=[1,1,2,2,2,8] b = list(map(int,input().split())) for i in range(6) : print(a[i]-b[i], end=' ') 4. [곱하기 과정 출력] A = int(input()) B = input() print(A * int(B[2])) print(A * int(B[1])) print(A * int(B[0])) print(A * int(B))
Python | py_basic_week1
- py_basic_week1 [변수 / 리스트 / 딕셔너리 / 조건,반복문 / 함수] 1. [enumerate.py] fruits = ['사과', '배', '감', '귤','귤','수박','참외','감자','배','홍시','참외','오렌지'] for i, fruit in enumerate(fruits): print(i, fruit) if i == 4: break 2. [list_prac.py] 짝수 몇개? num_list = [1, 2, 3, 6, 3, 2, 4, 5, 6, 2, 4] count = 0 for i in num_list : if i % 2 == 0 : count += 1 print(count) 전체 합은? num_list = [1, 2, 3, 6, 3, 2, 4, 5, 6, 2, 4] s..
Python | poo_game.py
[poo_game.py] from selectors import EVENT_WRITE from signal import pthread_sigmask from unittest import runner import pygame import random ################################################################################################################################# # 0.기본 화면 초기화 부분 pygame.init() #초기화 #화면 크기 조정하기 screen_width = 480 screen_height = 640 screen = pygame.display.set_mode((screen_w..
Python | memory_game.py
[memory_game.py] from multiprocessing import current_process import re from tabnanny import check import pygame from random import * ################################################################################################################################# # F.전역함수 선언 def setup(level) : global display_time display_time = 5 -(level // 3) display_time = max(display_time, 2) number_count = (l..
Python | weapon_game.py
[weapon_game.py] from math import gamma from multiprocessing import current_process from selectors import EVENT_WRITE from signal import pthread_sigmask from tracemalloc import start from unittest import runner import pygame ################################################################################################################################# # 0.기본 화면 초기화 부분 pygame.init() #초기화 #화면 크기 ..