00
Days
00
Hours
00
Mins
00
Secs
Artificial Intelligence Challenge / Ends February 11
🎁 Prizes: $100 / $50 / $25 Amazon Gift Cards

Ask coding questions

Posts
Pinned
40
Guide to Asking Coding Questions
# **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](https://repl.it/feedback) for feedback, or [repl.it/bugs](https://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 constantly - Make sure you 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. Thing 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](https://repl.it/feedback) for feedback, or [repl.it/bugs](https://repl.it/bugs) for bugs ## **Example:** ### **Question** We have some Python code with an error: [repl](https://repl.it/@Mosrod/Question-Tutorial) ```python rannumexe = int(input()) if rannumexe = 1: print('hi' + rannumexe) ``` ### Step 1 We show what each line does using comments. ```python rannumexe = int(input()) # Asks the user to input a rannumexe if rannumexe = 1: # If the rannumexe equals 1 print('hi' + rannumexe) # Print hi and the rannumexe ``` ### 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. ``` File "main.py", line 2 if rannumexe = 1: ^ SyntaxError: invalid syntax ``` ### Step 3 Our repl with the issue is located [here](https://repl.it/@Mosrod/Question-Tutorial). We have an issue on line 2 ### Step 4 We can change "rannumexe" to "number" to clear confusion ```python number = int(input()) # Asks the user to input a number if number = 1: # If the number equals 1 print('hi' + number) # Print hi and the number ``` ### 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](https://repl.it/@Mosrod/Question-Tutorial). 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 :). ```python number = int(input()) # Asks the user to input a number if number = 1: # If the number equals 1 print('hi' + number) # Print hi and the number ``` ``` File "main.py", line 2 if rannumexe = 1: ^ SyntaxError: invalid syntax ``` Steps based on Gordon Zhu's [post](https://medium.com/@gordon_zhu/how-to-be-great-at-asking-questions-e37be04d0603). If you have any suggestions or feedback, post it in the comments below.
19
posted by Mosrod (175) 4 months ago
2
RPG Game
![Uploading RPG Game.py...]() I would like to include combat between baddies and print the damage. Please can someone help?
4
posted by Adedamola (1) 1 day ago
14
Your chance to join TestOS2 development!
Sooooo developers get bored. So i wonder if your guys could spice up TestOS2 examples: apps new decor for program ideas submit the program in the comments https://repl.it/@Ryanand/TestOS-2-DEMO ![TestOS2](https://storage.googleapis.com/replit/images/1546374354709_a2e8efdbd38d4c05cbdfc3e560e53a1d.pn) Online question: Valve can't count to to three so do you think we can do it?
36
posted by Ryanand (21) 24 days ago
5
I need inspiration.
Hi, I'm Kyle, a Ruby programmer. I've just came back to coding after a long while, and was wondering if I could get some ideas. I don't know what to program, please help. Keep in mind I'll credit you in the program as well for giving me the idea.
14
posted by Zavexeon (31) 16 days ago
3
I need help with a small game! C++
So, I am working on a game for my assignment which I'm trying to keep simple. However, I'm getting confused watching people teach me how to do it. The game is about a story that involves combat/Adventure. (More info about this please let me know.) So I need to add like a betting game. So the player bets a number to 50, then the enemy will bet. and if the player wins the bet they continue, but if they lose I will add a loop of corruption to add a death kind of code haha. however, I want to add like a checkpoint to that section rather them having to do it all over again. if anyone knows how to do it please let me know! Thanks!
6
posted by Wo1ves1n0 (2) 7 days ago
1
What is wrong with my code?
I am trying to make a simple login (pretty much a DB) in python, the register works fine, it grabs the user and password, turns it into the user:pass format, and shoves it in the combolist.txt. But when i try and login with the said user:pass, it fails. REPL Link: https://repl.it/@AzureScripts/Simple-Database
4
posted by AzureScripts (6) 2 days ago
6
Ideas for the Challenge Tab
Here is a couple of ideas for the Challenge tab repl.it team, you could do OS's, or maybe programming languages. You could also have connect4. I have seen a lot of these in the repl.it 'share' section so those could be a possibility for the next challenge.
12
posted by HarveyH (77) 25 days ago
21
Can we have repl.it daily/weekly question?
I think repl should have a question of the day or question of the week. Questions like the advent of code thing. We could have users submit there questions submissions. That would be really cool and it would give people using repl.it challenges. **Check it out**: https://repl.it/talk/announcements/Repl-Weekly-Questioninfo/8960
9
posted by IEATPYTHON (374) 2 months ago
23
Music you guys listen to
Do you regularly listen to music? If so, what genres and artists of music?
60
posted by JSer (934) 4 months ago
1
hey everybody
Hi everybody. It's me again. And I'm still stuck on the same code despite all your effort to help me. I'm sorry. But could someone please explain to me why this what I'm currently doing isn't working. I honestly don't understand. Here's the link again, but I made a few changes. Here's the link: https://repl.it/@FARHEENPALAGIRI/Delete-every-third-character
4
posted by FARHEENPALAGIRI (5) 3 days ago
6
Ideas for Games
I have ran out of ideas for Python (games specifically), so if you could give me any ideas for games, that would be great!
9
posted by HarveyH (77) 24 days ago
3
homework help
You will notice that this code allows for interactive input using the Scanner class. Run the program with at least 2 different sets of input, including negative and positive values. Print the output screen for each set of input int age; Scanner input = new Scanner(System.in); System.out.print("Enter age: "); age = input.nextInt(); while(age <= 0){ System.out.println("Must be positive. "); System.out.print(" Enter age: "); age = input.nextInt(); } System.out.println("You entered " + age);
36
posted by SandyyyNwankwo (4) 2 months ago
1
Need help correcting an error * urgent*
The code is trying to calculate grade averages but I get an error in my method
3
posted by NanaOhene_Nyark (1) 1 day ago
1
Is Windows Batch/Batch File Supported on Repl.it?
Are we able to run batch files? For example: ```cmd echo This is my test prompt echo Choose A or B choice /c AB if %errorlevel% == 1 goto 1 exit 1: echo 1 ``` gives ``` This is my test prompt Choose A or B [A,B] B 1 ``` I know the Repl.it Servers and stuff are on linux, but there are many programs on linux that run batch. Even the editor recognizes batch.
5
posted by HarperframeInc (25) 4 days ago
2
Where are the files of installed Python packages stored?
I’m trying to understand where Repl.it stores the files of Python packages downloaded from PyPI, particularly executable scripts. Consider for example the [pep8](https://pypi.org/project/pep8/) style checker that can be run from a Linux shell by executing the `pep8` script. If I use the REPL’s package manager to install this package the script is nowhere in `PYTHONPATH`. Under `'/home/runner/.site-packages'`, which is listed in `sys.path`, there’s a `pep8.py` file that seems the right one but it’s not a directly executable script like the `pep8` one mentioned in the package’s documentation. More generally, where does Repl.it store any installed executable (i.e. that have the `+x` permission set) bash or Python files in a Python REPL?
2
posted by PaoloAmoroso (8) 4 days ago
2
What do you have to do to get the "Content Creator" tag?
I've been looking at peoples profiles and am seeing this "Content Creator" tag. To be honest, I got a bit jealous that they had this tag and I didn't. Nah, I'm just kidding. What does it take to get that tag, though? I'd be proud to earn it.
6
posted by Zavexeon (31) 14 days ago
3
Why is my javascript not working on all of my pages?
I´ve tried to connect my JS(script.js) to other files on my project, only works with index.html. here is my project https://repl.it/@Jose_CC/Photo-page-project . Please help, I love relp! I dont want to stop using it because of a small problem like this
17
posted by Jose_CC (2) 1 month ago
1
1 line code challenge
Who can create the coolest thing in just one line of code.
4
posted by gantr833 (27) 5 days ago
12
My first coding class with Tim. thoughts?
I'm learning more how to code with @timmy_i_chen what do you think I should learn?
15
posted by hayaodeh (71) 3 months ago
8
Girl wants to get good at coding...
Hi, my name is Cate and I recently discovered I had an interest in coding so with literally zero experience I started teaching myself python using pycharm IDE. I understand concepts pretty well, but there is soooo much information out there, does anyone have any tips for a n00b like me? Or advice for narrowing down a direction in regards to learning? Any help is appreciated!!
30
posted by catejenn (11) 4 months ago
6
Can Repl.it have a Stack overflow community?
Can Repl.it it have a stack overflow community. It would be cool if you could then transfer reputation over to repl.it. I think 1 cycle for 10 reputation would be cool.
9
posted by PYer (778) 2 months ago
1
something wrong about my code.
I am looking to find The Ohm Law by using v = i*r. but when I run my code the v still 0 as I defined. Any thought for it ? #include <iostream> using namespace std; int main() { int v = 0; int i = 0; int r = 0; v = i * r; cout << "Please input the resistance: " ; cin >> r ; cout << "Please input the current: "; cin >> i ; cout << " Your voltage is:" << v << endl; return 0; }
4
posted by khainguyen1707 (0) 6 days ago
18
Repl talk
I wonder why Repl talk isn't called "Reply". A perfect opportunity for a play on words.
8
posted by ChandlerMorell (61) 4 months ago
Locked
1
who am i?
existensial crisis
4
posted by eaz (0) 6 days ago
2
https://repl.it/@Angelos_ThomasP/DearShortEmbed
There is an error in line 85 please help fix it
5
posted by Angelos_ThomasP (3) 11 days ago
1
Help/Python [Solved]
I'm trying to create code that checks a number's truthiness. Because: if 0: print('run if true") #no output if 1 : print ('run if true') #output: run if true ... I want to create a program to check this and there is lot's of errors, please help!!! https://repl.it/@JerryTheMouse/numberTruthynessChecker
10
posted by JerryTheMouse (1) 24 days ago
1
Code is wrong but I am unsure where and how...
https://repl.it/@HibaBiba/Age This code is to check if the age inputted is valid within a specific range, however, if the input was wrong the first time, and the second time the input is correct, the code still asks the user again for their age. What have I done wrong and how can I fix this? Have a nice day c:
3
posted by HibaBiba (0) 2 days ago
4
What is your favourite language and could you post your favourite project below?
# Context As I see the repl community growing, it is great to see such a diversity of community of languages growing. I have been coding for about 3 months now: and my projects are coming along. ## My current favourite and my project. I personally have python as my favourite at current, due to the fact I am most capable with this language. I like messing around with turtle also . I have to say I am proud of this [pixel art tutorial](https://repl.it/talk/learn/How-to-draw-Pixel-Art-on-Python-with-Turtle/7556). as I feel it is a quite helpful tutorial for beginners, and helps them to get into more complex code with functions and parameters. It would be really nice to see what your favourites are in the comments and your work that you are most proud of! ### I wish you a great day! #### John_WardWard
12
posted by John_WardWard (110) 2 months ago
3
Possible Repl Talk (Ask) Solution
I've seen tons of posts on the site without repl links. These posts stay unanswered with no activity after the canned response "Please post the link to your repl". My solution is either to have some sort of validation, or have a tag next to the post confirming the user has their repl link in the post. This will make going though posts a lot easier: the ones without a link will not have a tag, and the ones with a repl link will have a tag. This would maybe less "spammy" by doing the opposite: tag on ones WITHOUT a repl link. Just a ease of tension for the posts without a link (and no future responses)
2
posted by Vandesm14 (24) 12 days ago
11
Can you make the notifications page work?
There is a page [Notifications](https://repl.it/notifications), that does nothing. I think that it could have good potential if it was actually used. I think that you should get notifications when someone up votes your post, comments on your post, or pings you. Also, you could make it so that it told you when you moved a position on the leaderboard. It could also tell you whenever a new competition started, or when one of your posts got pinned. If anybody else has some ideas they want the page to say, comment below please! Thank you!
4
posted by PYer (778) 2 months ago
Load more