Hey @deep marten!
Please edit your message to use a code block
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
53 messages ยท Page 1 of 1 (latest)
Hey @deep marten!
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
@deep marten
Remember to:
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Im supposed to get this output of 10#25#15 but that's not really what I'm getting
And I don't understand about this program itself
import random
L = [5, 10, 15, 20, 25, 30]
for i in range(1, 3):
first = random.randint(1, 4) # Indices 1 to 4
second = random.randint(1, 4) # Indices 1 to 4
third = random.randint(1, 4) # Indices 1 to 4
print(L[first], L[second], L[third], sep='#')
Since you're using random you can't really say "I'm supposed to get this exact output" because well, ...that's the whole point of random
The thing is
Im supposed to find the output
From like 4 options
can you explain a bit more about what you're trying to do?
Basically with the program that i gave I'm supposed to find the output and it is one of the following options
a)10#25#15
20#25#25
b)5#25#20
25#20#15
c)30#20#20
20#25#25
d)10#15#25#
15#20#10#
As Tathya pointed out though, you're dealing with randomness so you can't expect to get those exact results
But the thing is it's for my school and they say I'm supposed to get one of these
Ok but it's random, you can't guarantee anything
Oh
Do you have an assignment sheet you were given with instructions?
Nope
My teacher says you can get output with this information
Just that program
You might get that output, but not everytime
Oh
Without knowing exactly what is being asked of you, it's hard to write code that meets those conditions
Wait the question says write possible output(s) expected to be displayed at the time of execution of the following program
But if that's the case all the 4 options could be correct right
all possible outputs? Or just a few potential ones?
All possible outputs
more than one of these is correct then
But option d is wrong right
why?
Yes, you're right
Is there any mistake in option b or c tho
Oh my mistake, there is only one correct answer then
Can you tell what's the correct answer and the mistake in the other 2 options then
Well your random int is only selecting whatever is in index 1-4
Do any of those have numbers found in other index positions?
What numbers are found in index 1-4?
10,15,20,25
Oh yeah b and c doesn't have
๐
Thank you so much!
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.