- 1
Why not work?
20 Réponses
+ 2
Python is a type of snake, snakes don't go to work.
But if you were talking about Python code, then you better share the code link. Otherwise no one knows what's wrong.
https://www.sololearn.com/post/74857/?ref=app
+ 2
The problem is indentation.
The print statement is indented but under what??
Solution:
Make print statement align with value (inthe previous statement) or the for loop
+ 1
Relax man, when I open this thread first time there was no code link in the Description. I wouldn't ask you to share the link otherwise.
And about the code, you have indentation problem, and Idk why you put an empty line within the loop. If you remove the empty line and outdent the last line, your code works w/o problem 👌
+ 1
import random
for damage in range(2):
value = random.randint(50,1200)
print(damage) # this is outdented
0
Helpe me why my select number game do not work!!!!
https://code.sololearn.com/cEpjkB37stHZ/?ref=app
0
My friend you need to understand how to indent your code properly. This is too important to miss, especially if you're coding Python.
Please look at this tutorial code 👇
https://code.sololearn.com/cT5BRIbkia21/?ref=app
0
https://code.sololearn.com/cmCVJhVdX99t/?ref=app
0
import random
for damage in range(2):
value = random.randint(50,1200)
print(value)
0
You have a lot of indentions and spaces so you can try to delete some of it. You just need is the indention before for loop
0
There are 4 extra spaces in line number 5 that causing IndentationError , just remove them.
- 1
What are you talking about my code is here and this code is so complex that in going to apply for a job in Google with it...
https://code.sololearn.com/czEy1E380ubX/?ref=app
- 1
No intiendo, no travaho!!!! Do not work without lines to get her dirty snake
- 1
How do I now print the number which computer selected?
https://code.sololearn.com/cEpjkB37stHZ/?ref=app
- 1
Then it prints too much stuff out and it aint showing me the goddamn lucky number!
- 1
import random
for damage in range(2):
value = random.randint(50,1200)
print(value)
- 1
import random
for damage in range(2):
value = random.randint(50,1200)
print(damage)
- 2
There is an indentation error in your code. Just put the print statement on the correct position.
Like:
def......
Value...............
Print(damage)
'''
But your code is like this.
def...........
Value............
Print (damage)