본문 바로가기
반응형
별찍기(정사각형) star_string = " * " size = int(input("please input size")) for i in range(size): print(star_string *size) 2020. 2. 8.
숫자야구 게임 import random print("야구게임을 시작합니다 !!!\n--------------------------") i = random.randint(1,9) j = random.randint(1,9) k = random.randint(1,9) result = [str(i),str(j),str(k)] # 야구게임 정답 print('답: ',result) # 확인용 지울거얌 answer = [] strike_count = 0 ball_count = 0 try_count = 0 while(strike_count 2020. 2. 8.
로또 번호 생성기 import random lotto = [] game = int(input("lotto 게임 수를 입력하세요:")) print("===============================") for m in range(1,game+1): for a in range(1,8): i = random.randrange(1,46) lotto.append(i) lotto = list(set(lotto)) bonus = random.randint(1,46) lotto.sort() #리스트 정렬 for overlap in range(0,3): if (len(lotto) != 7): last = random.randint(1, 46) lotto.append(last) print(lotto,'+',lotto.pop()) l.. 2020. 2. 8.
구구단 게임 import random import time import numpy as np import sys def check(x): #정답 체크 global correct_count if(x == int(result)): print("정답!! :",str(result)) correct_count = correct_count + 1 elif( int(x) != int(result)): print("오답!! :",str(result)) # correct_count = correct_count - 1 else: print("뭐야??") def question(a): #문제 생성하기 global result b = random.randint(2, 4) numbers = [random.randint(2, 12) for .. 2020. 2. 8.
tensorflow 2.0 기초 분류 (가이드 기본 이미지 분류) # 파이썬 라이브러리 임포트 from __future__ import absolute_import, division, print_function, unicode_literals, unicode_literals import tensorflow as tf from tensorflow import keras import numpy as np import matplotlib.pyplot as plt # 패션 mnist 데이터 로드 fashion_mnist = keras.datasets.fashion_mnist (train_images, train_labels), (test_images, test_labels) = fashion_mnist.load_data() # 이미지 출력시 필요한 변수 저장 class_nam.. 2020. 1. 17.
jupyter notebook 백그라운드 실행 jupyter notebook 백그라운드 실행 장점 : terminal을 종료해도 connection 보장 nohup jupyter notebook & 2020. 1. 9.
반응형