I
I
Ilya1992018-05-31 14:01:21
Python
Ilya199, 2018-05-31 14:01:21

cmd won't start. Because of which?

Compiled python to exe, like the author in the video. The program, of course, is not the same as his, but just for testing. So, when he starts to run it - everything is fine, the launch goes through cmd, as it should. I start it, it just starts to turn on and immediately turns off, even its interface does not have time to load completely

spoiler
import random
random.shuffle(koloda)

print('Поиграем в очко?')
count = 0

while True:
    choice = input('Будете брать карту? y/n\n')
    if choice == 'y':
        current = koloda.pop()
        print('Вам попалась карта достоинством %d' %current)
        count += current
        if count > 21:
            print('Извините, но вы проиграли')
            break
        elif count == 21:
            print('Поздравляю, вы набрали 21!')
            break
        else:
            print('У вас %d очков.' %count)
    elif choice == 'n':
        print('У вас %d очков и вы закончили игру.' %count)
        break

print('До новых встреч!')

I took the program from the site where they showed how to compile python to exe

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anatoly, 2018-05-31
@Ilya199

On the site you copied from, koloda is defined a little higher. Be careful.

deck definition in article
5b0fef1a28465541060251.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question