Ask coding questions

← Back to all posts
its still not working plz help
mikebarlow

I'm still really new at this sorry I'm problem going to be here a lot

Answered by Spacecraft [earned 5 cycles]
View Answer
Voters
mikebarlow
Comments
hotnewtop
mikebarlow

here is what the console and debugger say if it helps
File "main.py", line 23
else:
^
IndentationError: expected an indented blo
File "main.py", line 16
loadout=input(" whats your class assassin warrior,archer or, magic").lower()
^
TabError: inconsistent use of tabs and spaces in indentation
 Traceback (most recent call last):
File "main.py", line 18
else print("bye"):
^
IndentationError: expected an indented block
 Traceback (most recent call last):
File "/opt/dap/python/run", line 34, in <module>
_main()
File "/opt/dap/python/run", line 30, in _main
runpy.run_path(target_as_str, run_name="main")
File "/usr/lib/python3.8/runpy.py", line 264, in run_path
code, fname = _get_code_from_file(run_name, path_name)
File "/usr/lib/python3.8/runpy.py", line 239, in _get_code_from_file
code = compile(f.read(), fname, 'exec')
File "main.py", line 18
else print("bye"):
^
IndentationError: expected an indented block

Spacecraft

@mikebarlow Wow, there's a number of things wrong with your code here. Where to start...
1- You can't arbitrarily indent lines. Only do so after statements, functions, etc.
2- When indenting, you can't mix tabs and spaces. Pick one.
3- ELSE statements must be immediately followed with :
4- You can have multiple ELIF statements, but only one ELSE
5- You probably don't want to have a PRINT statement inside your IF statement.

I've scrubbed your code a bit to fix some of these errors. Here it is:

Can I suggest that you should probably look around on replit in the tutorials section for some of the basic principles of how to use Python? It's worth taking the time to learn the basics up front. This will save you tons of time in writing code that doesn't work due to errors in almost every line.

mikebarlow

thank you for the help ill take your advice
@Spacecraft