#Программа сравнивает рандомный список с тем что напишет пользователь и выводит ошибки
import random
list1 = list ( "aaaa" )
list2 = list ( "bbbb" )
list3 = list ( "cccc" )
v = random .randrange ( 1 , 4 )
if v == 1 : #рандом связан со списками
print ( "напишите" , list1)
d = list1
elif v == 2 :
print ( "напишите" , list2)
d = list2
elif v == 3 :
print ( "напишите" , list3)
d = list3
o = list ( ) #ошибки
h = list ( input ( ":" ) )
print ( h)
print ( d)
for n in h: #проверка вхождения и добавление в ошибки
if not n in d:
print ( list ( n) )
o.append ( n)
else :
print ( "ошибок нет" )
print ( "Какие элементы попали в список" , o, "ошибок" , len ( o) )
I9Cf0YDQvtCz0YDQsNC80LzQsCDRgdGA0LDQstC90LjQstCw0LXRgiDRgNCw0L3QtNC+0LzQvdGL0Lkg0YHQv9C40YHQvtC6INGBINGC0LXQvCDRh9GC0L4g0L3QsNC/0LjRiNC10YIg0L/QvtC70YzQt9C+0LLQsNGC0LXQu9GMINC4INCy0YvQstC+0LTQuNGCINC+0YjQuNCx0LrQuAppbXBvcnQgcmFuZG9tCmxpc3QxID0gbGlzdCgiYWFhYSIpCmxpc3QyID0gbGlzdCgiYmJiYiIpCmxpc3QzID0gbGlzdCgiY2NjYyIpCgp2ID0gcmFuZG9tLnJhbmRyYW5nZSgxLCA0KQoKaWYgdiA9PSAxOiAgICAj0YDQsNC90LTQvtC8INGB0LLRj9C30LDQvSDRgdC+INGB0L/QuNGB0LrQsNC80LgKICAgIHByaW50KCLQvdCw0L/QuNGI0LjRgtC1IiwgbGlzdDEpCiAgICBkID0gbGlzdDEKZWxpZiB2ID09IDI6CiAgICBwcmludCgi0L3QsNC/0LjRiNC40YLQtSIsIGxpc3QyKQogICAgZCA9IGxpc3QyCmVsaWYgdiA9PSAzOgogICAgcHJpbnQoItC90LDQv9C40YjQuNGC0LUiLCBsaXN0MykKICAgIGQgPSBsaXN0MwpvID0gbGlzdCgpICAgICPQvtGI0LjQsdC60LgKaCA9IGxpc3QoaW5wdXQoIjoiKSkKcHJpbnQoaCkKcHJpbnQoZCkKZm9yIG4gaW4gaDogICAj0L/RgNC+0LLQtdGA0LrQsCDQstGF0L7QttC00LXQvdC40Y8g0Lgg0LTQvtCx0LDQstC70LXQvdC40LUg0LIg0L7RiNC40LHQutC4CiAgICBpZiBub3QgbiBpbiBkOgogICAgICAgIHByaW50KGxpc3QobikpCiAgICAgICAgby5hcHBlbmQobikKICAgIGVsc2U6CiAgICAgICAgcHJpbnQoItC+0YjQuNCx0L7QuiDQvdC10YIiKQoKcHJpbnQoItCa0LDQutC40LUg0Y3Qu9C10LzQtdC90YLRiyDQv9C+0L/QsNC70Lgg0LIg0YHQv9C40YHQvtC6IixvLCAi0L7RiNC40LHQvtC6IiwgbGVuKG8pKQ==
stdout
('\xd0\xbd\xd0\xb0\xd0\xbf\xd0\xb8\xd1\x88\xd0\xb8\xd1\x82\xd0\xb5', ['c', 'c', 'c', 'c'])
:
stderr
Traceback (most recent call last):
File "<builtin>/app_main.py", line 75, in run_toplevel
File "prog.py", line 19, in <module>
h = list(input(":"))
EOFError