#python #anaconda #jupyter-notebook #visual-code #html #css #javascript #http

제목파이썬 질문이요(중딩인데..)2020-10-15 09:04
작성자

(아;;실수로 본명썼네요..모르는척좀;;;)


홀짝게임을 만들고 있는데요...독학하고 있거든요?기초인데도 잘 안되네요..

첨부파일 말고 그냥 제가 입력한 소스 쓸게요


import random

com=['2','1']

comn = random.randint(1,100)

man=int(input('홀수 또는 짝수을 고르세요.\n홀수=1\n짝수=2\n>>>'))

print('컴퓨터 숫자: ',comn,'\n===================================================')

if com[comn%2]==man:

    print('당신이 이겼습니다!(≧∇≦)종료하려면 enter키를 누르세요...')

elif man==1 and com[comn%2]==2:

    print('컴퓨터가 이겼습니다!╰(*°▽°*)╯종료하려면 enter키를 누르세요...')

elif man==2 and com[comn%2]==1:

    print('컴퓨터가 이겼습니다!╰(*°▽°*)╯종료하려면 enter키를 누르세요...')

elif man==0 or man >= 3:

    print('잘못입력했습니다')

print('===================================================')

input()


여기 까지가 제가 입력한 소스인데요,이상하게 컴퓨터가 홀수,제가 짝수이거나 컴퓨터가 짝수,제가 홀수이면 '컴퓨터가 이겼습니다!╰(*°▽°*)╯종료하려면 enter키를 누르세요...'이 문장이 안떠요..뭐가 문제일까요??

댓글