Ask coding questions

← Back to all posts
Guide to Asking Coding Questions
h
Mosrod

Guide to Asking Coding Questions

Why?

Good questions help your question be solved faster, and people will want to answer your question

Bad questions waste time, you will often not get answers that you asked for, and people will often ignore your questions

Quick Questions Guide

Do This

  • Always ask your questions in English
  • Explain what you want the code to do
  • Explain what the code does
  • Include error messages
  • Share the repl with the line numbers
  • When you figure out the answer, update your post
  • Put the repl link, instead of pasting code

Don't Do This

  • Don't post homework questions
  • Don't use caps in the title
  • Don't use words like 'HELP' or 'PLEASE' in the title
  • Don't post questions that already have an answer (Search Box)
  • Don't post feedback or bugs on Talk, use repl.it/feedback for feedback, or repl.it/bugs for bugs

Steps For Better Questions

  1. Understand the code

    • Read your code and figure out what each line does
    • If a concept is unfamiliar, Google it
    • You can also use a debugger to help you
  2. Describe the problem

    • Explain what you want the code to do
    • Explain what the code does (error messages)
  3. Provide the code

    • Share a repl that has your code
    • Share the line number(s) of your code issue
    • Make sure that the code you shared has the issue
  4. Format code consistently

    • Make sure your code is easy to read
  5. Check for typos

    • Make sure the code does not have any typos that would cause the problem
  6. Explain what you did to troubleshoot the problem

    • Make a list of what you think the problem is and try to fix your problem by going through the list
  7. Make a guess on what you think the problem might be

    • Use the list from the previous step
  8. Proofread the question

    • Make sure you provided everything
    • Clear all confusions that you think there might be
  9. Update people on the question

    • If you figured out the answer, edit the post to tell people
    • When you get an answer, fully understand it
    • Be nice to people who answer your question
    • Remember that the people wanted to answer your question, but didn't have to
  10. Things to NOT do

    • Don't post homework questions
    • Only post questions in English
    • Do not use caps in the title
    • Do not use "HELP" or "PLEASE" in the title
    • Don't post questions that have already been answered (Use search box)
    • Don't post feedback or bugs on Talk, use repl.it/feedback for feedback, or repl.it/bugs for bugs

Example:

Question

We have some Python code with an error: repl

Step 1

We show what each line does using comments.

Step 2

We want the code to input a number, and if the number is one, print "hi" and the number.

Our problem is that we have an invalid syntax error on line 2 in the main.py file.

Step 3

Our repl with the issue is located here.

We have an issue on line 2

Step 4

We can change "rannumexe" to "number" to clear confusion

Step 5

We don't have any typos

Step 6

Our problem could be that we improperly used the if statement

Step 7

The problem could be about using the if statement incorrectly

Step 8

Our final question:

Title:

Invalid syntax error about equal signs

Content:

I have an invalid syntax error on line 2 in the main.py file of this repl. The program should take a number as an input, check if the number is equal to one, and if so, print "hi" and the number. The error point to the equal signs and I think this issue is with the incorrect syntax of the if statement. Help is appreciated :).

Steps based on Gordon Zhu's post.

If you have any suggestions or feedback, post it in the comments below.

Voters
LaneMartin
kfatty03
BenasAlonderis
maxina
CodeMaster007
VXZELL12345
AchalJhawar
ChopSueyMaster
Beeatrice
arscenic
Comments
hotnewtop
MikeW3

repl.it/feedback and repl.it/bugs are broken links

[deleted]

Is stackoverflow useful?

P0GCHAMPB0i

What if I acidently delete my account that has important stuff?

InvisibleOne

Then you better hope you remember all that code @P0GCHAMPB0i

VulcanWM

why would you do that-? @P0GCHAMPB0i

P0GCHAMPB0i

@VulcanWM i dunno

P0GCHAMPB0i

what if somebody went on somebodies account what would they do?

InvisibleOne

Depends on the person. If it was me, I would change their name to "Banana Pickle" and make ten repls that all try and rick roll the person running them. @P0GCHAMPB0i

P0GCHAMPB0i

What if i created my own programming language?

InvisibleOne

That would be cool @P0GCHAMPB0i

zaydi

So for my eight bit project i need a search bar can somebody help me by telling me some code for one that can find da games

winnerwannabe2

what do i do if in py i get a unexpected use of indents and spaces?

ruiwenge2

@jcfjfc just re-indent your code

ruiwenge2

@jcfjfc i had the same problem before

winnerwannabe2

@ruiwenge2 o i forgot about this a few min of internet and i fixed it. thx tho!

Elisyn25

Is there a language called Python 3 in replit.com?

SixBeeps

@Elisyn25 Yes, it's the language named 'Python'

26eldrpa

how can i add a username and password to my repl it, so that you cant use it without entering a certain username and password, and how to add more usernames and passwords.

InvisibleOne

What lang? @26eldrpa

BranstinR

I already made mad libs but this is better!!!!

daivikm
STCollier

I'm making mad libs, and my input (eg., noun_1 = input("Noun: ") will only take numbers. If I put in letters, it will not work and shows error. Why is this not working? (I am using Python btw)

rreieurjreh

creat a class representing a player in a video game

InvisibleOne

@rreieurjreh

YoungChamp

use 2 equal to sign instead of 1.

InvisibleOne

@garena

MARCELOMALCA

e

InvisibleOne

​​​​

NicholasSutin

How do i get hole 196 code? hehe

fishers14

how do you make an if ... on repl, I am new to it. Or atleast I forgot :)

InvisibleOne

If statement? What lang?
Python

Javascript

java

@fishers14

ryanjbwang

@InvisibleOne JavaScript is 1 === 1

InvisibleOne

Really? I thought it still worked just didn't check if they were the same type (ie, string, integer, etc,)
@ryanjbwang

fishers14
fishers14

@InvisibleOne I found out! thanks

fishers14

@InvisibleOne thanks a lot for helping me

UnluckyFroggy

If I eat myself will I get twice as big or disappear completely?

FlaminHotValdez

@UnluckyFroggy Depends. If u eat urself all at once u will disappear, otherwise you will stay the same size because you're basically moving all the mass of your body into your stomach.

GalaxyWolfX

@FlaminHotValdez Infinite mirror phenomenon

FranklinStopar

@FlaminHotValdez what about when you get to your mouth...how do you eat your mouth

FlaminHotValdez

@FranklinStopar uhhhhhhhhhhhhhh bite your lips. can you bite your lips?

FranklinStopar

@FlaminHotValdez can you bite your teeth?

FlaminHotValdez
FranklinStopar

@FlaminHotValdez so how can you eat your teeth broski...

FlaminHotValdez

@FranklinStopar by grinding them together into powder and swallowing it

FranklinStopar
NathanTodd2

but do you have a throught???
@FranklinStopar

CHRISTIANMATTHY

@UnluckyFroggy If you spam the same comment on popular threads over and over, is this annoying or dumb?

[deleted]

@UnluckyFroggy, First of all your size will be the same. Second, you would look very gross with your stomach inside out.

P0GCHAMPB0i
mechtank

@UnluckyFroggy bruh how can you resist the pain

[deleted]

@ScTaR actually you wont live to see the result. Watchers will also die just looking.

[deleted]

@CHRISTIANMATTHY the best comment on replit

[deleted]

For me I have to change it to:
number = str(input()) # Asks the user to input a number
if number == "1": # If the number equals 1
print('hi' + number) # Print hi and the number

marcowismerlms

hi :D

robert34

The information I received from your article is extremely helpful, I am sure that you are also looking forward to your contributions skribbl io

CoolCoder200089

vfvf

CoolCoder200089

hi do you want to join me on HTML
CoolCoder200089

HoogidyBoogidy

"Always answer your questions in English" Do I have to? Can I say it in German, español, or anything else?

Wumi4

@HoogidyBoogidy Yes. Since English is probably the most popular language now.

HoogidyBoogidy

@Wumi4 Yeah, but what happens if you get taught english the wrong way?

SixBeeps

@HoogidyBoogidy I'm late but broken english is still preferred over another language. Don't ask me why, but that's just how it is.

ElijahNarvaez

Ah, I have put help in the title in every post I've made asking for help. im now reading this. Will probably forget and use help anyway tho.

elipie

Hmm that would still generate an error, because you need to use str(num) otherwise it will make the code think that you are adding the two string and numbers

Smart0ne

AHHHHH I WANT A DEBUGGER FOR PYTHON, BUT THERE DOESN'T EXIST ANY ON REPL.IT

Wumi4

@Smart0ne pdb doesn't work?

fmaida

@Smart0ne Try https://pypi.org/project/pudb/

It's a very nice visual debugger that runs in the terminal and it should work on repl.it as well.

CodeLongAndPros

@Smart0ne Press Ctrl+Shift+s and enter python3 -m pbd main.py

TravisRaney

how does this code works?

Kookiez

@TravisRaney what code

hanbot

dont add :

CodersXD

It would be nice if someone can help me with my problem, it isn't an error, it is the Python Turtle module, so I created a mini project, a character that moves by W A and D, and a bot turtle, I can make bots move random places but does someone know how to make the turtle bot follow you? It would help a lot of someone knew, thanks!
Link - https://repl.it/@CodersXD/Python-turtle-help#main.py

InvisibleOne

Just check if the player is above you, and move up, or check if the player is to the right and move right, something along those lines @CodersXD