Hướng dẫn python odd or even game - trò chơi python lẻ hoặc chẵn

#Here tôi xác định chức năng người dùng và CPU

cpu_num = random.randint(1,6)
user_selection = ["Odd", "Even"]

def cpu_choice():
    choice = random.randint(1,6)
    print("The computer's choice is",choice)
    return choice

def user_choice():
    while(True):
        choice = input("Odd or Even? ")
        if choice in user_selection:
            print("Your choice is",choice)
            return choice
        else:
            print("You did not write your answer correctly, please try again.")            

#Trong chức năng này, tôi xác định kết quả của mỗi vòng dựa trên các công thức trước đó và hai biến mới (num_round và user_lives) và mọi thứ đều hoạt động tốt

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick

#Mọi thứ hoạt động tốt cho đến khi ở đây, tôi không biết tôi đang làm gì sai trong chức năng người chiến thắng

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')

Cho ba số nguyên dương x, y và P. ở đây p biểu thị số lượt. Bất cứ khi nào rẽ là lẻ x được nhân với 2 và trong mỗi lần lượt y được nhân với 2. Tác vụ là tìm giá trị của tối đa (x, y) min (x, y) sau khi p hoàn chỉnh.

Ví dụ: & nbsp; 

Đầu vào: x = 1, y = 2, p = 1Output: 1Explanation: As lượt là lẻ, x được nhân với 2 và trở thành 2. Bây giờ, x là 2 và y cũng là 2. & nbsp; do đó, 2 ÷ 2 là 1.X = 1, Y = 2, P = 1
Output : 1
Explanation: As turn is odd, X is multiplied by
2 and becomes 2. Now, X is 2 and Y is also 2. 
Therefore, 2 ÷ 2 is 1.

Đầu vào: x = 3, y = 7, p = 2Output: 2Explanation: & nbsp; ở đây chúng ta có 2 lượt. Trong lượt thứ nhất là lẻ được nhân với 2. và các giá trị là 6 và 7. & nbsp; trong lượt tiếp theo thậm chí y được nhân với 2. Bây giờ các giá trị cuối cùng là 6 và 14. Do đó, 14 ÷ 6 là 2.X = 3, Y = 7, p = 2
Output : 2
Explanation: Here we have 2 turns. In the 1st turn which is odd
X is multiplied by 2. And the values are 6 and 7. 
In the next turn which is even Y is multiplied by 2.
Now the final values are 6 and 14. Therefore, 14 ÷ 6 is 2.

Hãy chơi trò chơi trên cho 8 lượt: & nbsp; & nbsp;
 

| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |

Ở đây chúng ta có thể dễ dàng phát hiện ra một mẫu: & nbsp; & nbsp;
 

if i is even, then X(i) = z * X and Y(i) = z * Y.
if i is odd, then X(i) = 2*z * X and Y(i) = z * Y.

Ở đây Z thực sự là sức mạnh của 2. Vì vậy, chúng ta có thể nói đơn giản - & nbsp; & nbsp;
 

If P is even output will be max(X, Y) ÷ min(X, Y) 
else output will be max(2*X, Y) ÷ min(2*X, Y).

Dưới đây là việc thực hiện: & NBSP;

C++

#include

using namespace std;

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
0
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
1
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
0
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
3__

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
8

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
0
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
1

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
3
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
4

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
6

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
3
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
9

| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
0

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
0
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
2

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
8

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
0
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
6

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
8

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
if i is even, then X(i) = z * X and Y(i) = z * Y.
if i is odd, then X(i) = 2*z * X and Y(i) = z * Y.
0

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
8

| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
0

C

if i is even, then X(i) = z * X and Y(i) = z * Y.
if i is odd, then X(i) = 2*z * X and Y(i) = z * Y.
4

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
0
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
1
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
0
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
3__

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
8

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
0
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
1

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
0
If P is even output will be max(X, Y) ÷ min(X, Y) 
else output will be max(2*X, Y) ÷ min(2*X, Y).
9

#include 0#include 1

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
0#include 4

#include 0#include 6

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
3
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
4

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
0using2

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
3
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
9

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
0using7

#include 0using9

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
0
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
1

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
3
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
4

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
6

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
3
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
9

| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
0

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
0
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
2

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
8

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
0
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
6

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9std;9
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
00
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
01
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
02

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
if i is even, then X(i) = z * X and Y(i) = z * Y.
if i is odd, then X(i) = 2*z * X and Y(i) = z * Y.
0

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9std;9
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
00
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
01
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
02

| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
0

C

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
0
If P is even output will be max(X, Y) ÷ min(X, Y) 
else output will be max(2*X, Y) ÷ min(2*X, Y).
6

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
0 #include 9

#include 0using4

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
3 namespace5

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
8

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
3 std;0

Java

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
39
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
40

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
6

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
11
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
12

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
13
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
14

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
0

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
16
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
17
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
0
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
1
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
0
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
3______
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
23

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
8

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
24
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
0
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
7

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
71

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
63
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
74
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
69

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
77
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
78
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
69

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
81
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
32
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
69

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
85

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
0

| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
0

Python3

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
0
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
31
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
32
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
33
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
34
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
35

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
36
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
3
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
38

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
36
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
3
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
45
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
32
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
47

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
6
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
99

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
39
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
49
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
32
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
51

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
16
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
17
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
57
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
58

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
0
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
63
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
64
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
65
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
32
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
67
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
64
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
69

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
89
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
90

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
36
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
37

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
0
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
93
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
94
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
32
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
96
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
96
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
34__

Các

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2___

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
36
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
48

C#

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
27
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
96
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
64

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
30
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
96
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
32

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
8

#include 0using4

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
3 namespace5

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
8

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
3 std;0

Java

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
74
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
75

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
6

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
11
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
12

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
74
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
82

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
0

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
13
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
14

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
8

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
0
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
6

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
96

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
98

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
00

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
02

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
96

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
0

| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
0

PHP

| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
08

| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
09
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
1
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
11
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
12
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
13
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
12

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
8

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
0
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
00
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
15
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
22

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
3
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
25
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
11
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
12
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
13
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
29

| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
30
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
31
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
11
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
12
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
13
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
35

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
6

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
3
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
40
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
11
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
12
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
13
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
29

| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
30
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
46
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
11
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
12
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
13
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
35

| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
0

| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
11
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
53

| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
13
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
55

| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
15
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
53

Is

| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
11
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
69
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
13
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
71
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
15
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
55

Is

| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
84

| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y(i) | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |11 | i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y(i) | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |69| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y(i) | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |13 | i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y(i) | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |71| i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y(i) | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |15 | i | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |------|---|----|----|----|----|----|----|-----|-----| | X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X | | Y(i) | Y | Y | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y | 16Y |55

| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
85

JavaScript

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
8

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
09
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
88

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
0
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
1

def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
2
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
6

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
36
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
3
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
96

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
| i    | 0 | 1  | 2  | 3  | 4  | 5  | 6  | 7   | 8   |
|------|---|----|----|----|----|----|----|-----|-----|
| X(i) | X | 2X | 2X | 4X | 4X | 8X | 8X | 16X | 16X |
| Y(i) | Y | Y  | 2Y | 2Y | 4Y | 4Y | 8Y | 8Y  | 16Y |
0

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
if i is even, then X(i) = z * X and Y(i) = z * Y.
if i is odd, then X(i) = 2*z * X and Y(i) = z * Y.
05

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
if i is even, then X(i) = z * X and Y(i) = z * Y.
if i is odd, then X(i) = 2*z * X and Y(i) = z * Y.
07
if i is even, then X(i) = z * X and Y(i) = z * Y.
if i is odd, then X(i) = 2*z * X and Y(i) = z * Y.
08
if i is even, then X(i) = z * X and Y(i) = z * Y.
if i is odd, then X(i) = 2*z * X and Y(i) = z * Y.
09

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
if i is even, then X(i) = z * X and Y(i) = z * Y.
if i is odd, then X(i) = 2*z * X and Y(i) = z * Y.
0

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
9
if i is even, then X(i) = z * X and Y(i) = z * Y.
if i is odd, then X(i) = 2*z * X and Y(i) = z * Y.
13

if i is even, then X(i) = z * X and Y(i) = z * Y.
if i is odd, then X(i) = 2*z * X and Y(i) = z * Y.
14

def round_result():
    num_rounds = 0
    user_lives = 10
    while num_rounds < 8 and user_lives > 0:
        user_pick = user_choice()
        cpu_pick = cpu_choice()
        if (cpu_pick % 2 == 0) and (user_pick == "Even"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
        if (cpu_pick % 2 == 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Even"):
                    print (f'You have {user_lives - cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives - cpu_pick
        if (cpu_pick % 2 != 0) and (user_pick == "Odd"):
                    print (f'You have {user_lives + cpu_pick} lives left')
                    num_rounds += 1
                    user_lives = user_lives + cpu_pick
36
def winner():
    user_won = user_lives > 0 and num_rounds == 8
    cpu_won = user_lives < 0
    game = round_result()
    while game:
        if user_won is True:
            print ('You won')
        if cpu_won is True:
            print ('Cpu won')
3
if i is even, then X(i) = z * X and Y(i) = z * Y.
if i is odd, then X(i) = 2*z * X and Y(i) = z * Y.
01
O(1)
Auxiliary Space: O(1)


Làm thế nào để tôi tạo ra một trò chơi thậm chí kỳ lạ trong Python?

cpu_num = ngẫu nhiên.randint (1,6) user_selection = ["lẻ", "thậm chí"] def cpu_choice (): lựa chọn = ngẫu nhiên.randint (1,6) in ("Sự lựa chọn của máy tính là", lựa chọn) Lựa chọn trả về def user_choice (): while (true): lựa chọn = input ("lẻ hay thậm chí?

Python có hiểu kỳ lạ và thậm chí không?

Ngay cả chương trình lẻ trong Python sử dụng toán tử bitwise, chúng tôi cũng có thể sử dụng các toán tử bitwise trong các chương trình chẵn lẻ trong Python.Các toán tử bitwise là các nhà khai thác giúp chúng tôi thực hiện các hoạt động bit (bitwise).We can also use Bitwise Operators in even-odd programs in python. Bitwise Operators are the operators that help us to perform bit (bitwise) operations.

Có nghĩa là gì trong Python?

Toán tử == so sánh giá trị hoặc bình đẳng của hai đối tượng, trong khi đó, toán tử là toán tử kiểm tra xem hai biến có hướng đến cùng một đối tượng trong bộ nhớ hay không.Trong phần lớn các trường hợp, điều này có nghĩa là bạn nên sử dụng các toán tử bình đẳng == và! =compares the value or equality of two objects, whereas the Python is operator checks whether two variables point to the same object in memory. In the vast majority of cases, this means you should use the equality operators == and !=