Diff
checker
文本
文本
圖像
文檔
Excel
文件夾
Legal
Enterprise
桌面版
定價
登入
下載 Diffchecker 桌面版
比較文本
尋找兩個文字檔案之間的差異
工具
歷史
即時編輯器
摺疊未變更行
關閉換行
檢視
拆分
統一
比對精度
智能
單詞
字符
語法突出顯示
選擇語法
忽略
文字轉換
前往第一個差異
編輯輸入
Diffchecker Desktop
執行Diffchecker最安全的方式。取得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.")
尋找差異