Diff
checker
텍스트
텍스트
이미지
문서
Excel
폴더
Legal
Enterprise
데스크톱
요금제
로그인
데스크톱 앱 다운로드
텍스트 비교
두 텍스트 파일의 차이점을 찾아보세요
도구
기록
실시간 편집
변경 없는 행 숨기기
줄바꿈 비활성화
레이아웃
나란히 보기
합쳐 보기
비교 단위
스마트
단어
글자
구문 강조
언어 선택
제외
텍스트 변환
첫 변경으로
수정
Diffchecker Desktop
가장 안전하게 Diffchecker를 사용하는 방법. 데스크톱 앱을 사용하면 비교 데이터가 외부로 전송되지 않습니다!
데스크톱 앱 받기
Untitled Diff
생성일
4년 전
비교 결과 만료 없음
초기화
내보내기
공유
설명
15 삭제
행
총
삭제
글자
총
삭제
이 기능을 계속 사용하려면 업그레이드해 주세요
Diff
checker
Pro
요금제 보기
48 행
복사
10 추가
행
총
추가
글자
총
추가
이 기능을 계속 사용하려면 업그레이드해 주세요
Diff
checker
Pro
요금제 보기
46 행
복사
복사
복사됨
복사
복사됨
#
j
aka to liczba nowa
edycja
#
J
aka to liczba nowa
próba
import random
import random
def powitanie():
def powitanie():
print(
print(
"""
"""
복사
복사됨
복사
복사됨
Wita
m
w
grze
'Jaka to liczba'
Wita
j
w
programie
'Jaka to liczba'
Twoim zadaniem jest odgadnięcie liczby
wylosowanej przez komputer
""")
""")
def yes_or_no(question):
def yes_or_no(question):
response = None
response = None
복사
복사됨
복사
복사됨
while response not in
("t", "n"
):
while response not in
('t', 'n'
):
respon
s
e = input(question).lower()
respon
e = input(question).lower()
return response
return response
복사
복사됨
복사
복사됨
def ask_number(question, low, high):
def ask_number(question, low, high):
response = None
response = None
while response not in range(low, high):
while response not in range(low, high):
response = int(input(question))
response = int(input(question))
return response
return response
def main():
def main():
powitanie()
powitanie()
yes_or_no("Czy jesteś gotowy?")
yes_or_no("Czy jesteś gotowy?")
guess = ask_number("Podaj liczbę: ", 1, 100)
guess = ask_number("Podaj liczbę: ", 1, 100)
tries = 10
tries = 10
number = random.randint(1, 100)
number = random.randint(1, 100)
while guess != number:
while guess != number:
복사
복사됨
복사
복사됨
if tries
=
= 0:
if tries
<
= 0:
break
break
if guess < number:
if guess < number:
print("Za mała...")
print("Za mała...")
elif guess > number:
elif guess > number:
print("Za duża...")
print("Za duża...")
else:
else:
print("Zgadłeś!")
print("Zgadłeś!")
guess = ask_number("Podaj liczbę: ", 1, 100)
guess = ask_number("Podaj liczbę: ", 1, 100)
tries -= 1
tries -= 1
복사
복사됨
복사
복사됨
if guess == number:
if guess == number:
복사
복사됨
복사
복사됨
print("Zgadłeś
.
Chodziło mi o liczbę: ", guess)
print("Zgadłeś
!
Chodziło mi o liczbę: ", guess)
elif tries
=
= 0:
elif tries
<
= 0:
print("
Wyczerpałeś wszystkie
próby!")
print("
Skończyły ci się
próby!")
main()
main()
복사
복사됨
복사
복사됨
input("\n\nAby zakończyć
program
naciśnij enter.")
input("\n\nAby zakończyć
naciśnij enter.")
저장된 비교 결과
원본
파일 열기
# jaka to liczba nowa edycja import random def powitanie(): print( """ Witam w grze 'Jaka to liczba' Twoim zadaniem jest odgadnięcie liczby wylosowanej przez komputer """) def yes_or_no(question): response = None while response not in("t", "n"): response = input(question).lower() return response def ask_number(question, low, high): response = None while response not in range(low, high): response = int(input(question)) return response def main(): powitanie() yes_or_no("Czy jesteś gotowy?") guess = ask_number("Podaj liczbę: ", 1, 100) tries = 10 number = random.randint(1, 100) while guess != number: if tries == 0: break if guess < number: print("Za mała...") elif guess > number: print("Za duża...") else: print("Zgadłeś!") guess = ask_number("Podaj liczbę: ", 1, 100) tries -= 1 if guess == number: print("Zgadłeś. Chodziło mi o liczbę: ", guess) elif tries == 0: print("Wyczerpałeś wszystkie próby!") main() input("\n\nAby zakończyć program naciśnij enter.")
수정본
파일 열기
# Jaka to liczba nowa próba import random def powitanie(): print( """ Witaj w programie 'Jaka to liczba' """) def yes_or_no(question): response = None while response not in ('t', 'n'): respone = input(question).lower() return response def ask_number(question, low, high): response = None while response not in range(low, high): response = int(input(question)) return response def main(): powitanie() yes_or_no("Czy jesteś gotowy?") guess = ask_number("Podaj liczbę: ", 1, 100) tries = 10 number = random.randint(1, 100) while guess != number: if tries <= 0: break if guess < number: print("Za mała...") elif guess > number: print("Za duża...") else: print("Zgadłeś!") guess = ask_number("Podaj liczbę: ", 1, 100) tries -= 1 if guess == number: print("Zgadłeś! Chodziło mi o liczbę: ", guess) elif tries <= 0: print("Skończyły ci się próby!") main() input("\n\nAby zakończyć naciśnij enter.")
비교하기