1 One 5 Zero 2 3 Two 3 2 Three 4 4 Four 5 1 Four >


For the following code, match the outcome if x =


The answers I got were wrong


1 One<br>5 Zero<br>2<br>3 Two<br>3<br>2 Three<br>4<br>4 Four<br>5<br>1 Four<br>><br>

Extracted text: 1 One 5 Zero 2 3 Two 3 2 Three 4 4 Four 5 1 Four >
import random<br>x = random.randint (0,5)<br>if x == 5:<br>print (x,' Zero')<br>elif x == 4:<br>print (x, 'One')<br>elif x == 3:<br>print (x,' Two')<br>elif x == 2:<br>print (x,'Three')<br>elif x == 1:<br>print (x, 'Four')<br>else:<br>print (x,'Five')<br>

Extracted text: import random x = random.randint (0,5) if x == 5: print (x,' Zero') elif x == 4: print (x, 'One') elif x == 3: print (x,' Two') elif x == 2: print (x,'Three') elif x == 1: print (x, 'Four') else: print (x,'Five')

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here