RBGoat
@RBGoat
your average stupid noob
0
< and > operators not working (python)
I am making a personality quiz, and I can't seem to get the comparison operators to work. Basically, the program is supposed to ask a question and then change variables depending on the answer.
if favNum > "aaa":
ambP = ambP + 1
print("ambP" + ambP)
elif favNum < "aa":
smolP = smolP + 1
print("smolP " + str(smolP))
ambP and smolP are personality results abbreviated. I used strings "aa" and "aaa" because otherwise there is an error saying I cannot compare strings and ints.
The problem is that no matter what the length of the answer, ambP never gets added to and it just skips over it to smolP.
Yes, I am aware this doesn't encompass answers that are two digits long. Ima add another elif and variable later for that.JustCoding123 @RBGoat The error is the the `input` function returns a string so you cant compare with an int. To compare it with an int you neeed to convert it to an int, like: `int(input("What is your favorite number? "))`. 1 year ago
2
2
0
0
[NOT DONE] Facepalmer ForumsThis will be a social media app (without private chat) where users all over the world can talk in forums about their interests and passions and stuff.
We are currently looking for collab members, especially JS coders. Even if you are a beginner, we would be glad to have you working on this project! This was started by a beginner, so...
wrong element is changing
I am trying to make a theme button (dark mode, light mode) and I am working on the basic code (later I'll add a variable to determine what mode it's already in and therefore what mode it should change to.) I want the theme button to change the body background, but instead it changes the theme button's background. I defined the function earlier in the body.
function themeChange(body) {
body.style.background = "black";
}
Then there is a button that runs that function: ``
How do I make it change the body, instead of the theme button?
(Before you comment about me taking a screenshot of Replit's theme button and making it way too big and obvious, this is just preliminary coding. I'll add the art later.)
NFadhlurrahman @RBGoat Because there is the `body` parameter, and you set it to `this`. When you define the click event using the `onclick` attribute in HTML, `this` refers to the button itself. That means the `body` that the button changes is the theme button. Change `this` to `document.body`.
```html
<button onclick="themeChange(document.body)"><img src="theme.png"></button>
```1 year ago
6
3
0
I am trying to make the basics for the order form on my website. I made an HTML, JS, CSS repl. In the HTML part there is an input box and then a butto
HTML, CSS, JS
tussiez You need to use a `` tag.
Remove the ` tag, and add the following before the ` tag:
You will also need to replace getInput; with getInput(). This calls the function1 year ago
Coder100 to import a script file, use script tags. Change line 4 to
change line 8 to
submit
in index.html.
In script.js, add some code inside getInput!1 year ago
YimingKong getInput; is not how you call a function relative to onclick. Replace it with getInput()1 year ago
Edit: Answered. Thanks!
I used the tag to add an image in HTML, but it shows a little picture icon instead of showing my PNG file. Does it need to b
HTML, CSS, JS
SixBeeps You need to upload the image to the Repl in order to use it. To do that, just drag the image into the Files pane, or seleft 'Upload file' in the three-dots menu.1 year ago
I am new at c++, and I tried using the code
console.WriteLine("Hello World");
but it did not work. Instead, it produced an error message saying some
C++
TurtleAndrew For some more detail on the cout syntax, you can do it with one argument:
cout << "hello world";
But also more then one:
cout << "hello world 1" << "hello world 2" << "hello world 3";
You can also have it go down a line by adding "endl" (without the quotes) instead of text:
cout << "hello world" << endl;
Note that if you don't have:
using namespace std;
that you will need to add "std::" (without the quotes) before "cout" and "endl" (without quotes):
std::cout << "hello world" << "hello 2 years ago
Whenever I paste the website link on my iPad, it shows that there is an image but it doesn't show the actual Pickle logo. I tried it on my Chromebook,
HTML, CSS, JS
Coder100 The image url is not actually an image, instead a link to an image. So it isn't a valid image and can't be rendered.
Use this link instead:
IMG_05182 years ago
Please check it out I know it's low quality and beginner level but I worked really hard on it.
HTML, CSS, JS
So, I got a coding book about Python. (Previously I used Scratch.) It said to ask for input, type the following command:
username=input("What is your
Python
Coder100 You forgot to use the + operator to combine two strings together!
print("hello!")
username=input("What is your username?")
print("Hello, " + username)
but that isn't very readable, how about using fstrings?
print("hello!")
username=input("What is your username?")
print(f"Hello, {username}")
much better2 years ago