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.")
查找差异