Online Music Hackathon

First Prize: $5000

Ends on Jul 22:
00
Days
00
Hours
00
Mins
00
Secs

Ask coding questions

Posts
Pinned
72
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 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](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.
31
posted by Mosrod (262) 10 months ago
Pinned
13
⛈Brainstorm ⛈What should we code?
The last time I had one of these threads, we got a lot of cool answers. So... let's kick this off again! What should we code? What should I, Katya, code?
40
posted by katyadee (835) 26 days ago
2
I cloned this repo, what's next?
Hello! I cloned this repo, but now I'm stuck. The readme assumes I will be installing Node.js locally, though I'd like to make it work here in Repl.it. I've tried several things that seem to make sense but it does not seem to produce the demo app shown in the README. Help! Thanks.
9
posted by ryantmurphy (1) 1 day ago
2
JS (+HTML) - how to save (leaderboard) data - for music jam!
Hi everyone, I'm making a game for the repl.it music jam, called [Name That Tune](https://Name-that-tune--thomass1.repl.co). The code is [here](https://repl.it/@ThomasS1/Name-that-tune). I've made the game itself (although I need to add lots more tunes!), but I'm now looking for a way to have a leaderboard. I've made the leaderboard HTML itself (`index.html` lines 67-121) and the JS functions to put the data into the table (`script.js` lines 190-254), but I need a way to save the data itself. I've tried various different approaches: ##### Using jsonstore.io Jsonstore is a brilliant online data storage website, but as far as I can tell you need node.js to be able to interact with it. See [TheDrone7's post about his node.js jsonstore extension](https://repl.it/talk/share/Dont-ever-lose-your-data-again-with-jsonstoreio-JS-Edition/10999). I don't know how to/if you can use node.js with an HTML/CSS/JS repl. I even tried using python, but calling the functions from JS proved an absolute pain. As I expected. ##### Other ways? Are there ways to save data which can be changed in JS without using external things like jsonstore? I looked into json files and other stuff, but as you can probably tell, I'm a bit out of my depth. I'm a beginner with JS and thought the music jam would be a fun way to learn some more! Thanks in advance for any help!
14
posted by ThomasS1 (35) 3 days ago
answered
1
switch statement
Create a property called testScore of type Int. Write a switch statement that will print out a grade based on the student's score. Score Criteria A+: 97%-100% A: 93%-96% A-: 90%-92% B+: 87%-89% B: 83%-86% B-: 80%-82% C+: 77%-79% C: 73%-76% C-: 70%-72% D+: 67%-69% D: 63%-66% D: 60%-62% F: 0%-59% let testScore = 90...1 switch testScore { case 0...59: print("grade F") case 60...69: print("grade D && D+") case 70...79: print("grade C && C+") case 80...89: print("grade B && B+") case 90...100: print("grade A && A+") default: print("All student's testScore") }
5
posted by Triecie77 (0) 13 hours ago
33
What should we code?
I've seen a couple of posts around here where people are asking what they should work on next. Let's use this space to brainstorm some cool projects.
112
posted by katyadee (835) 2 months ago
17
SCHOOL'S OUT! IT'S SUMMER!!! 🌞 What are your summer coding plans?
SCHOOL'S OUT FOR BASICALLY EVERYONE, finally! Do you have any summer coding goals? What are they? Mine are... * get really good at HTML & CSS * learn JS
102
posted by katyadee (835) 1 month ago
answered
3
Question about Python GUI automation.
I am new to Python coding and am interested in using it to automate some of my work. I am currently an intern, and most of my work is data entry related, so Python seems like a great thing to learn. However, is there any way to automate the keyboard or mouse in repl.it such as the way 'Automate the Boring Stuff' does? I have searched for this topic a lot and have received no results. I have found that REMI is a possible solution for this but have not been able to get it to work. Before I continue trying to automate on Repl.it, is it even possible to control the keyboard and mouse?
8
posted by ndeering (2) 5 days ago
13
What line of code describes you best? 🤔
Okay, I lifted this from Quora, but I thought it was a really cool question with lots of ways to interpret it! What line of code describes y'all best?
34
posted by katyadee (835) 1 month ago
13
If you could ask the Repl.it team anything, what would you ask?
It could be about the product, a coding question, or even something personal (within reason)! I'll see if I can wrangle answers for ya.
40
posted by katyadee (835) 1 month ago
answered
29
Default name challenge
Create a default-named repl and do whatever the name says Submit your repls here __NEWS:__ __ @neodymium [TinySpicySeptagon](https://repl.it/@neodymium/TinySpicySeptagon) is the winner of this challenge! And the reward is 5 cycles__ __HONOURABLE MENTIONS__ __ @Kognise [BeigeDullMotion](https://beigedullmotion--kognise.repl.co/) and [ExtralargeWateryFonts](https://extralargewateryfonts--kognise.repl.co/), the repls are very accurate of the title!__ __ @a5rocks [BitesizedMindlessComputationalscience](https://repl.it/@a5rocks/BitesizedMindlessComputationalscience) for the code!__ __ @Steven_The_GuyT [FinancialRottenFile](https://repl.it/@Steven_The_GuyT/FinancialRottenFile) for it's humor!__ __ @Vandesm14 [LovingJovialOmnipage](https://lovingjovialomnipage.vandesm14.repl.co/) for it's awesomeness!__ __Special thanks to all of the upvoters and contestants in this challenge!__
99
posted by mkhoi (178) 2 months ago
answered
40
How Did YOU Find Repl.it
Repl.it is one of many online coding platforms. How did you find this one? Did you do a google search? A friend? Why did you choose Repl.it over the many others that exist out there. Currently repl.it is one of the most popular. I will say that if i google's filtering and searching system were different, i wouldn't have found it. I found Repl.it with `online python3`. Comment below your own story! ### Reasons so far: + Coding on multiple computers + Learning at school + Looking for better online compilers/interpreters + Searching on google for online <coding language> + Friends + Coding in school without downloading interpreters/compilers + Making games that wouldn't work on normal compilers/interpreters + Entering competitions that require repl.it + Storing code online. To show other people, or other uses It's really cool to see how other people found repl.it. If I had been told to list as many reasons as I could, I would have gone with Bullet 1, Bullet 2, Bullet 3, and maybe Bullet 5.
221
posted by PYer (2045) 4 months ago
answered
1
How to exit REPL process in correct way?
I would like to exit REPL so I could run my package scripts . ![Annotation 2019-07-16 131357](https://storage.googleapis.com/replit/images/1563257720302_0e69e8d6c794fdd859a4ffcb7fd81a1e.png) Is there anyway to do? It seems the REPL is auto restart every time I try to exit.
11
posted by dangtu (1) 5 days ago
answered
51
Repl.it Mobile App
As some of you may know, Repl.it isn't the most mobile-friendly website. I'm considering making a mobile app for it, and I'm asking the community: Would you be interested in this? Would you use it if it was good enough? And does anyone here want to help contribute? I'm open to any suggestions about technologies to use and I'm up to learning something new. Please upvote or comment if you'd use it and comment if you want to help. And if you aren't interested I'd love to hear why. Thanks! **UPDATE:** Until there's something more official, I made [a Discord server](https://discord.gg/sVxJJZA). **UPDATE 2:** I just [released our MVP](https://repl.it/talk/announcements)!!!
38
posted by Kognise (203) 3 months ago
8
What's your most impressive repl?
What's the coolest repl you've ever created? For me, easy - it's any of the newsletters.
20
posted by katyadee (835) 25 days ago
2
Integer division
What does double slash do in python, and what is integer division?
4
posted by ImiekameLonge (1) 3 days ago
8
Game Brainstorm
In the "what should I make" thread @amasad expressed his wish for another multiplayer game. He wanted it to be more community focused than some of the multiplayer shooters. I decided to act on it and am planning to make a multiplayer faction-based game. I currently envision four factions starting in the center of a large map and having the opportunity to explore/battle each other. I also would love to have the in-game accounts linked to repl.it accounts. However this would require some input from repl.it themselves. I imagine the character just being a profile pic with a circle around it indicating a faction color. I would also, however like your input on this. If you think that factions would just split the community then explain why here. I want to hear your thoughts in the comments. Also, if you know HTML and Javascript you are welcome to offer your help. If you are good at making art I would be thankful for your help as well. Regards, @kaldisberzins
50
posted by kaldisberzins (255) 1 month ago
12
Calendar/Habit Tracker
I’ve been starting to code a new project that I aim to be a multi-platform habit tracker, calendar, and class manager. Would anyone be interested in helping with this project? I would appreciate any ideas or suggestions. Current Contributers: Myself Codesalim Random String Of Numbers Hey it’s Marcus Planned features: General Calendar Events/Assignments Making School Planner Languages Express Pug Css JavaScript Nodejs Progress Server set up Getting current date You can see the current progress here: https://unitracker--ryanhallihan.repl.co/ From, Ryan
44
posted by ryanhcode (85) 2 months ago
answered
2
Can Anyone help me write this in java script
Exercise One: In this exercise you will be creating two functions. // Function One: Will be called 'multiply'. // This function will take two parameters, both numbers // This function will return the two numbers multiplied together. // Function Two: Will be called 'calculator'. // This function will take three parameters, // First will be a callback function, // Second and Third will be numbers. // This function will return the two numbers passed into the callback function. // NOTE: You can use the multiply function to test the calculator function, but understand that // other callback functions will be passed into it as a test.
24
posted by faziz6006 (2) 19 days ago
answered
1
conditionals and options
Write a program for your smart thermostat. Do the following using a temperature, isRaining, and isOn property, If the temperature is less than 68 degrees or it is raining, the Air Conditioning should be turned off. Otherwise the Air Conditioning should be turned on. Try different combinations of temperatures and weather conditions (raining vs not raining) to make sure your thermostat works correctly. Use a print statement to check the air conditioning's status. let temperature = 68 If temperature < 68 { print("the Air Conditioning should be turned off") }else if temperature >= 68 print("the air conditioning should be turned on")
4
posted by Triecie77 (0) 1 day ago
answered
10
Daily Question #7: What is your most important possession?
Nobody posted on my Daily Question yesterday, however, i am hoping to change that with today's question! What is your most important Possesion? Mine is my books. I don't really take anything to heart, apart from books. Books let me travel to a different world when things get harsh in my own eyes. Meme of the day: ![image](https://storage.googleapis.com/replit/images/1561466647643_ffc143a87130dfd13a37ad51d362eacd.png)
10
posted by ReshiramWolfu (61) 26 days ago
1
BeatTapper
A game where you can listen to some awesome music.
6
posted by SickCreator7737 (0) 3 days ago
answered
13
What is the language you recommend the most? Why do you recommend it??
Well, the title says the most. Just searching for a new one to learn. Mine is in fact, Python 3.7. I like Python 3.7, because it runs on like everything, even on my small raspi zero. Mh I should add that I, in this moment, I speak Python, R, in advanced 8/10 levels of skill, HTML in beginner level, as I do in CSS and C++. JS in mid levels of skill
44
posted by enigma_dev (83) 2 months ago
answered
13
Which is better: Terraria vs. Minecraft??
Which one's better? Please type in the comments below and try to convince me about which one's better. I'm having such a difficult time deciding. Please help!
94
posted by CollinKunsman (20) 3 months ago
18
What was your first language and what did you make with it?
What was your first language and what did you make with it? Me... I learned some rudimentary HTML & CSS on Neopets and made a fan site for MTV TRL veejay Jesse Camp, who was my celeb crush at the time. (Bonus points for anyone old enough to remember him.) I think that counts, right?
52
posted by katyadee (835) 2 months ago
answered
3
i dont know what im doing
Name: Wind-Chill Calculator Points: 100 Important Notes Format the output using the sample output in the Example Output section as a guide A programming environment has been setup online Connect to the server using an SSH client such as Bitvise (Windows users only - Apple users can access the server via the Terminal program) Note: The Bitvise SSH client is pre-installed on School of Computing computers IP Address: 139.62.210.180 Port: 22 Log onto the server Note: The username and password values are case-sensitive. Username: Your N# (i.e., n00123456) Password: idc2000password Students are required to change their password immediately after logging onto the server Edit the project1.py file using the pico text editor Note: Save your changes before exiting the pico editor or closing the SSH client. Enter the command, pico project1.py Run the program Enter the command, ./project1.py The textbook provides information about the Python language in a number of different sections 1.8 Data and Programming (pp. 57-63) 2.6 Programming Data Manipulation (pp. 108-116) 6.3 Procedural Units (pp. 280-287) This website (Links to an external site.)provides introductory lessons and examples for Python The lessons in the following categories will be helpful in completing Project 1 Introduction Flow Control (Python if...else lesson only) Functions (Python Function and Function Argument lessons only) Function Requirements Your program MUST utilize the following functions (included in the project file on the Linux server): def calculateWindchill(temperature, windSpeed): def convertTemperature(temperature): def displayOutput(temperature, windSpeed, fWindChill, cWindChill): def withinRange(value, min, max): def main(): Function Descriptions calculateWindChill Accepts the temperature (in Fahrenheit) and wind speed values Calculates the wind chill using the equation provided below Returns the result of the wind chill calculation convertTemperature Accepts the wind chill temperature (in Fahrenheit) Converts the temperature from Fahrenheit to Celsius using the equation provided below Returns the result of the temperature conversion displayOutput Accepts the temperature, wind speed, wind chill (Fahrenheit) and wind chill (Celsius) values Displays the values to the monitor (refer to the Example Output section) The function does not return anything (no return statement is necessary) withinRange Accepts the user's input value, the minimum value of the valid range, and the maximum value of the valid range Determines if the user's input value falls outside the specified valid range If the user's input value is outside the valid range Display an error message to the monitor (refer to the Example Output section) Returns true if the user's input value is within the valid range; otherwise, false main Prompt the user for a temperature value (refer to the Example Output section) Valid range is -58 to 41 Prompt the user for a wind speed value (refer to the Example Output section) Valid range is 2 to 50 Test if temperature and wind speed values are within their respective ranges If, and only if, both values are within range Calculate the wind chill Convert the wind chill result from Fahrenheit to Celsius Display the results to the monitor Program Logic The program must use the functions provided above DO NOT modify the provided functions DO NOT create any additional functions Display your name followed by a blank line Prompt the user for 2 integer numbers (i.e., 0, 1, 2, …) and store the entered values in variables Note: Display each prompt on a separate line. Outside temperature (to) Valid range: -58 to 41 (inclusive) Wind speed (v) Valid range: 2 to 50 (inclusive) After the user enters the values (temperature and wind speed), test the input by calling the withinRange function for each value Is the input within the valid range? Note: Use the return value of the withinRange function. If not, display the error message The entered value is out of range [x – y] Note: x and y represent the minimum and maximum values of the valid range, respectively. Note: If either of the input values (temperature or wind speed) are not within their valid range, after displaying the out of range error message, do not execute the remainder of the program (skip step 5). If the user’s input values (temperature and wind speed) are both within their valid ranges Call the calculateWindChill function and store the returned value in a third variable Note: Use the exact code below to calculate the wind chill temperature using the Wind Chill equation. windChill = 35.74 + 0.6215 * temperature - 35.75 * pow(windSpeed, 0.16) + 0.4275 * temperature * pow(windSpeed, 0.16) Call the convertTemperature function and store the returned value in a fourth variable Note: Use the exact code below to calculate the Celsius temperature using the Fahrenheit-to-Celsius equation. celsius = (temperature - 32) * 5 / 9 Call the displayOutput function Determine the minimum width of each column from the provided example Display wind chill values (Fahrenheit and Celsius) to 3 decimal places
3
posted by isiaht111 (2) 5 days ago
answered
2
Make Repls private by default
Hello, I have an account that allows for private repls, but they seem to be public by default. Is it possible to make my repls private by default? Thanks, Darragh
3
posted by darraghlong (2) 3 days ago
answered
5
Daily Question #4: What is your favourite, but weird word
This thread is coming along great, i should start giving away Cycles soon! Today's question; What is your favourite weird word? My favorite is pneumonoultramicroscopicsilicovolcanoconiosis. It is a lung disease caused by inhaling ash and dust. It is also the longest word in the english dictionary. Today's meme: ![image](https://storage.googleapis.com/replit/images/1561120977846_fc5201ce505cbcf8d0a6a11180989bd6.png)
23
posted by ReshiramWolfu (61) 30 days ago
answered
9
What should I make
I'm a beginner in python, and I don't know the big stuff. What should I make, and where can I learn more about the basics?
68
posted by CompleteStrange (11) 2 months ago
15
What advice would you give to someone new to coding?
In the spirit of our new ask features... * What advice would you give to a newbie? * And what advice do you wish someone had given you? * What advice would you give me, personally?
29
posted by katyadee (835) 2 months ago