What does this mean in my code?
Hi to all programmers among you,
What does it mean when this error message appears:
You can see the error in the code snippet above. It can't be due to impressions.
Hi to all programmers among you,
What does it mean when this error message appears:
You can see the error in the code snippet above. It can't be due to impressions.
How can I make this macro faster and more effective, and how can I prevent it from re-recognizing the values it already had when restarting? So that the 50 is ignored after the first time the sound is played. Code: Sub PlaySound() Dim ws As Worksheet Dim rng As Range Dim cell As Range Dim…
Hello everyone, my service company's website was created with Jimdo. Today, I came up with the idea of including a small calculator that visitors can use to independently calculate a non-binding quote based on square meters and other information. Is there a way to implement something like this, for example, using an HTML widget? If…
I've created an online form, and everything works fine on my server, but unfortunately, the JavaScript commands don't work on my client's. Even though it's the same form.
Created the code in a VM. Can someone please explain to me why?
I developed a software where the data store now had 2000 rows of data and I switched everything to a MySQL database with the pub.dev extension mysql_client . Now I have the problem that the extension does not support web. You can see my question above. Thanks for answers.
Do you know the meaning of indentations in Python? They seem to be a bit confused here.
No, not so. Where can I learn?
This should be almost at the very beginning in every Python course.
Maybe it will help you look at "Structograms" / "Nassi-Shneiderman diagrams" .
Break your code back into different levels – starting with
Note that "if", the "elif"s and "else" are always exactly the same far indented
(I also put it in again because it looks like this should be in a loop – otherwise "Write again!" would make no sense.)
Then separately write the block to be executed at "left":
In order to be able to use this block within [if Response == "left":], you enter it further than [if Response == "left":]:
I would then proceed from the order in such a way that I then establish the framework for the cases "right", "front" and "backward".
For this block, next follows the block for "Yes" within the block for "left":
And again the indentations:
etc.
All that is below one line and is moved further is dependent on this line, up to the first following line, which is only as far as or less far engaged.
You will check in line 25 whether the answer == "left". Even if this is not the case, line 28 is executed – check whether answer == "Yes". Regardless of the answer to this, next check is whether chance <= 0.6.
The if-block of [chance <= 0.6] in line 30 is continued at [else] in line 34 – this is the first line after line 30, which is also far indented – and is formally continued in line 37 with the [elif] – that is also far indented.
But
is inadmissible, of course there is an error message. How should the interpreter/compiler know that this elif belongs to the if in line 28? Finally, it has been taught that indentations and ONLY give indentations, which belonged together and what is subordinate.
🌺
Tip: take a text editor (or better a complete development environment) that “knows” the Python syntax. Then you will see at first glance what belongs together, and you can also “fold” whole blocks so that you can only see a coarser structure – this considerably promotes the overview.
At the very beginning, an advanced text editor like Notepad++ should be sufficient. Once it begins to become interesting, you will be grateful for an “integrated development environment” (IDE). On the Internet you can easily find a lot of discussions, which is now “best” and which is “most welcome” – you have to make yourself smart (and also decide whether you want to take a “lightweight” for the beginning and want to change later, or want to jump into the depths of thousands of settings at the beginning).
Thank you.
Ps: I learn Python alone at home, so I have many mistakes because I have never visited a Python course
The problem seems to me that you’re trying an Elif on the same level after an Else. This is insane and invalid.
If I understand the code correctly, you need to enter the previous if else block with the chance that the compiler understands that your Elif refers to the If answer= yes.
Similar in the other code. You need to distinguish the blocks from each other by pressing.
Generally, the code seems very confusing to me. See if a match case setup is not better.
https://www.freecodecamp.org/news/python-switch-statement-switch-case-example/
Thank you.
Simple: elif After other is a syntax error.
P.S.: However, there are many more errors in your code…
Thanks, but this sign that shows where the error lies shows after the no.(see latest addition)
Now you have a space in front of the elif, so it’s on the wrong level of engagement…
After an Else, no Elif can follow. Doesn’t make any sense, as all the remaining cases have already been negotiated in the Else.
The error message means that your code does not correspond to the valid syntax.
You need to get the print statement right in line 38.
Besides, the whole if, elif, else Wirrwarr doesn’t make any sense.
I can see this a little bad now, but I would say that there are no spaces.
So it doesn’t:
It’s hot.
Otherwise I don’t see a mistake.
(In the code before, you had always set spaces and the code now works up to the point where you didn’t set)
Thank you, but it wasn’t.
Okay, sorry. But it was worth a try.
so your problem has already been solved, but simply as a small tip:
please use blank characters everywhere the same, so not above zB x == y and below x=y that makes the code really unreadable
The meansthat you should first give UNBEDINGT the basics in logic and languages and learn how the syntax is correct in the new country. That the elif is not allowed to stand there and you have many other mistakes in it has already been written.
Sorry, I know, but thank you
I would ask Chat Gpt to copy the entire code directly and then the error message
Isn’t the double point missing in line 43 and 46?
Oh, yeah, I missed that. Thank you.