Make a Game. Win a Bitcoin.

00
Days
00
Hours
00
Mins
00
Secs

Jam Ended on Apr 19. Results coming soon!

Ask coding questions

Posts
Pinned
49
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. 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](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.
21
posted by Mosrod (196) 7 months ago
1
Completely random error
Hi, Any ideas on this error on line 18? No matter what i print i still get this error. Thanks!
2
posted by RossJames (4) 18 hours ago
1
Lambda Pre- Course question on Methods and 'this'.
I am having a problem with this assignment. I have to create a method for the object 'userobj'. There is already a key called 'name' and I have to add a method to 'userobj' called 'greeting'. I thought I got it, but the method has an error: "Label 'greeting' on function statement. Missing name in function declaration." on the line where I stated my code. Any help? Thanks! function exerciseTwo(userObj){ // Exercise Two: You will be given an object called 'userObj' // userObject will already have a key on it called 'name' // Add a method to userObj, called 'greeting'. // Using the keyword 'this', the greeting method should return the following string: // 'Hi, my name is ' and the users name. // eg: If userObj has a name: 'Dan', greeting should return: Hi, my name is Dan' // NOTE: DO NOT create a new object. // NOTE: DO NOT create a key called name the key is already on the object. greeting: function(){ return 'Hi, my name is ' + this.name; } // Please write all of your code on the lines above. return userObj; }
1
posted by vetorobert3 (0) 20 hours ago
1
Problem in compiling
Some codes do fine in repl.it but don't work well in codeblocks. Why is that?
1
posted by Gustavo_Cardoso (0) 21 hours ago
answered
3
tab error
hi, I have no idea why i have an error on line 14. Any ideas? thanks!
5
posted by RossJames (4) 1 day ago
1
Help in a project
Hey everyone, i was asked to do a project where i'm supposed to work with a file through my program with C but we didn't cover files a lot so i was hoping if someone could help me, through discord or something where we can interact in real time (I could give more info about the project if you contact me), my discord is Bakrouzif(Sky)#4129 sincerely,
5
posted by BakrOuzif (0) 2 days ago
1
CSS not linking to html
Hi, I am having problems where main in css will not show color even if it is any other attribute eg background color or font. Any ideas? Thanks
2
posted by RossJames (4) 2 days ago
1
Help me!
Can anyone help me fix my code? https://repl.it/live/M35T2afH0B8uDg
5
posted by erskineemily (0) 2 days ago
1
promo
Hi, I have a problem with my code because i need to send a file of html, css, js to the client. at the moment, i can only send one file, the html. thanks.
1
posted by RossJames (4) 2 days ago
1
Difficulty embedding a javascript/text item
Hi all, I should start by saying I am barely newbie level when it comes to computer programming. I am trying to embed a crossword puzzle into my repl but it is not working. Below is the embed code, as taken directly from the outside website's instructions: <script type="text/javascript" src="https://CrosswordHobbyist.com/embedjs?puzzle_id=621761"> </script> Does anyone know what the problem is? My repl is using html/css/js and has the following packages: { "name": "runner", "version": "0.1.0", "private": true, "dependencies": { "react": "^16.8.2", "react-dom": "^16.8.2", "react-scripts": "2.1.5", "bootstrap": "4.3.1", "jquery": "3.3.1", "react-router": "5.0.0", "react-router-dom": "5.0.0", "localforage": "1.7.3", "popper.js": "1.14.7" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, "eslintConfig": { "extends": "react-app" }, "browserslist": [ ">0.2%", "not dead", "not ie <= 11", "not op_mini all" ] } Thanks in advance for any help. Daniel
1
posted by dmatishek (0) 2 days ago
1
__dirname repl.it not working
Hi, I have a problem on line 6 of my code where __dirname is not defined. It is probably obvious but I have little js experience. thanks!
8
posted by RossJames (4) 2 days ago
1
Express not working
Hi, The express example in nodejs is not working and is having an error where it can't find express module. Any ideas? This one has had me stuck for a little while now Thanks!
3
posted by RossJames (4) 2 days ago
1
Code isn't running properly[URGENT]
When I run my code, it seems to be glitching. It isn't the code, as it was working one minute, but now it isn't. I tried to go back to previous versions, but it doesn't work! Here's the link to it. please let me know if the code works, and if there are any fixes to this. https://repl.it/@Abdul_QadirBhat/Assignment-2-String-Manipulation-v4 I've got to hand this in in a few days and I need to complete it! EDIT: The code is meant to have a menu displayed like this: ![image](https://storage.googleapis.com/replit/images/1555756328940_ff7c28f4fd25fe8f1643ed81b67bedaf.pn) But it just seems to be glitching when I run it and it doesn't allow me to input anything. It may be some error on the backend or something, but I don't know...I'm pretty sure it isn't my code...
5
posted by Abdul_QadirBhat (0) 2 days ago
1
How to draw a mathematical graph in Python?
Hi! I am a math teacher trying to draw a graph to a mathematical function in Python. I can’t possibly be the first person with this problem. Does anybody know a function for this? Please help me.
3
posted by DanielGottfrids (0) 2 days ago
1
Syntax error: Unexpected Number
https://repl.it/@OtakuMom/IST113-19S-LI-Final Okay, so I'm working on my final for my Web Programming class, and this has me kind of stumped. The message I'm getting is "Syntax Error: Unexpected number" on line 14, and being new to Javascript I don't know what that means. If anyone can help it would be greatly appreciated.
6
posted by OtakuMom (1) 3 days ago
1
Login system
I have created a login and register system in python 3, and I'm trying to do an if statement testing to see if the users login input matches the registered users in a separate file but it wont work! Any tips or help will be greatly appreciated! Code: https://repl.it/@OathOfCode/Login-System-Final
2
posted by OathOfCode (0) 3 days ago
1
Web Programming
I am looking to create a web page for one of my teachers that includes him or other students being able to enter data into some sort of form and then having it be displayed, so which language would be a good one to do something like this in?
15
posted by tperr (0) 3 days ago
1
help nested list is not letting me do stuff
https://repl.it/@ShamrockKing/CLICK In my pokemon project, i made a nested dictionary for the pokemon type damage chart, on its own it made no trouble but on every line below that i get syntax errors for anything i put https://repl.it/@ShamrockKing/CLICK
3
posted by ShamrockKing (0) 3 days ago
1
Turning [Currently] Fixed Rectangles, and other shapes-PYGAME
I have been programming in Pygame for a while now. Yet I don't know how to make objects spin. This line of code spins an image: `pygame.transform.rotate(image, degrees)` The problem is, it does not affect the rectangle behind it, and the image won't even spin in place. Can someone please help me?
2
posted by GrantKeo (34) 3 days ago
1
MeteorJS on repl.it
Is there a way to run a MeteorJS application or repl.it?
5
posted by tarekskr (0) 3 days ago
1
Pip version problem !
Hi, I had completed my first simple code for an assignment months ago, now that I have to write a report and etc about it, it needs to be ran few times. The issues is that, out of nowhere, from a working code, I get the following error all the time - You are using pip version 9.0.1, however version 19.0.3 is available. You should consider upgrading via the 'pip install --upgrade pip' command. Here is a link to my code - https://repl.it/@AleksandrosPro1/DarkorchidShockingTransfer Just to make it clear, I am fresh into programming in general.
4
posted by AleksandrosPro1 (0) 4 days ago
answered
1
Repl.it page 404's after it wouldn't load.
https://repl.it/repls/FickleCanineApplets I was working on some code, when upon hitting run, it wouldn't run. Hitting stop did nothing. I read that Google cloud services went down last time this happened. Now the page just 404's. Is there any reason for this?
4
posted by EamonBrennan (0) 4 days ago
1
Assembly
Will assembly be added to the list of languages? Particularly RISC and CISC syntax assembly. If not, will it be considered? Thanks.
1
posted by NEILSENBENJAMIN (23) 4 days ago
1
Just uploaded my game for Game Jam!
Hello Repl.It! Today is the last day for entries for game jam, and my game is finally ready for judgement! :) I just wanted to see when we might expect to hear back about the winner? This was an awesome idea, and it created a unqiue opportunity for me to create something and learn a TON about programming. Thank you again!
1
posted by jkeane889 (0) 4 days ago
1
Text File to Array (JS)
Hi, in my current project I have uploaded a text file to my project and I need to figure out how, in my main javascript file, how to turn it into an array. The closest I have gotten is shown below, which prints the file to the console, but I can't figure out how to put it into an array from here. ```js fetch(fileposition) .then(r => r.text()) .then(t => console.log(t)) ```
12
posted by iPenguin (2) 4 days ago
1
JS Assignment 13 Intro to Classes in Javascript
Hey could anyone who has done the lambda precourse work help me, I do not understand why my answer is wrong. here is the assignment link: https://repl.it/student/submissions/6438375 function ClassOne(name, pw, mail){ // Exercise One: In this exercise you will be creating your own class! // You are currently in the class, you are given three strings, name, pw, and mail. // You need to create three properties on this class. // Those properties are: 'username', 'password', and 'email' // Set the value of username to name, // Set the value of password to pw, // Set the value of email to mail this was my answer>>> function ClassOne(username, password, email) { this.username = name; this.password = pw; this.email = mail; }
32
posted by nda1 (0) 4 days ago
1
I need help!
class Application(Frame): def_init_(self, master): super(Application, self)._init_(master) self.grid() self.create_widgets() def create_widgets(self): self.buttn1 = Button(self, text = "I do nothing!") self.buttn1.grid() self.buttn2 = Button(self) self.buttn2.grid() self.buttn2.configure(text = "Me too!") self.buttn3 = Button(self) self.buttn3.grid() self.buttn3["text"] = "Same here!" root = Tk() root.title("Broken Brokens 2") root.geometry("200x85") app = Application(root) root.mainloop()
5
posted by CollinKunsman (3) 4 days ago
1
What's wrong with it?? Plz help...
It won't run. Can you PLEASE help me out?? ======================================== class Application(Frame): def_init_(self, master): super(Application, self)._init_(master) self.grid() self.create_widgets() def create_widgets(self): self.buttn1 = Button(self, text = "I do nothing!") self.buttn1.grid() self.buttn2 = Button(self) self.buttn2.grid() self.buttn2.configure(text = "Me too!") self.buttn3 = Button(self) self.buttn3.grid() self.buttn3["text"] = "Same here!" root = Tk() root.title("Broken Brokens 2") root.geometry("200x85") app = Application(root) root.mainloop()
3
posted by CollinKunsman (3) 4 days ago
1
What's wrong with it??? Plz help...
I made this program for School, but I don't know what's wrong with it. It won't run! Can you guys PLEASE tell me why it's not working?? ======================================================= class Application(Frame): def_init_(self, master): super(Application, self)._init_(master) self.grid() self.create_widgets() def create_widgets(self): self.buttn1 = Button(self, text = "I do nothing!") self.buttn1.grid() self.buttn2 = Button(self) self.buttn2.grid() self.buttn2.configure(text = "Me too!") self.buttn3 = Button(self) self.buttn3.grid() self.buttn3["text"] = "Same here!" root = Tk() root.title("Broken Brokens 2") root.geometry("200x85") app = Application(root) root.mainloop()
3
posted by CollinKunsman (3) 4 days ago
1
Help me fix my BlackJack pls!
Ok so I made a blackjack game but whenever I try and play and I try and raise or hold after I have already raised once it doesn't work! Try it for yourself so you can see what I mean. If anyone knows how to fix this, your help would be much appreciated! -THANKS!!! PS: my code sucks cuz i just started!
1
posted by Dormey (0) 4 days ago