Questions tagged [if-statement]
An "if" statement is a flow control structure in most programming languages that branches execution flow depending on a binary condition, generally evaluated at runtime. If statements are also commonly also called conditionals. When using this tag please also include an appropriate language tag, such as e.g. "java" if your question is language-specific.
if-statement
62,213
questions
-3
votes
2
answers
39
views
program doesn't start and there isn't an issue that comes up after I run it. While loops, myFunction() and if
I am making a program where you have to guess the secret password. If you don't then the program will alert you. I expect that the problem lies with label. I have tried innerText, innerHTML, ...
-7
votes
0
answers
26
views
Code will use "if", "else", "else if" statement [closed]
if, else, else if statement:
if
else
else if
Get JavaScript.
Get it for the JavaScript code.
Tips:
Use this if, else, else if statement.
Get if, else, else if statement.
What if the code will ...
0
votes
1
answer
12
views
PBI - Year total value does not reflect the DAX I wrote
Screen shot of my Dax and Table
All past data in actuals are finalized. If I only show actuals data, the full year graph looks off due to the rest of the year being 0.
So, we wanted to set if future ...
0
votes
0
answers
20
views
Depended dropdown with extra nested if statement
I have the following code, that works, for a depended dropdown menu.
Right now it does: IF Colomn 5<>"", then put depended dropdown of that name in Colomn 6.
And if Colomn 6<>&...
-3
votes
1
answer
70
views
How to repeat an action until something specific is entered?
This was my original idea:
import os, time
while True:
os.startfile(r"c:\Users\owcor\OneDrive\Desktop\notepad.exe")
time.sleep(5)
inp = input("")
if inp == "...
0
votes
4
answers
65
views
Why does my if statement return false when using 'and not'? [duplicate]
I am trying to make a hangman game in python for practice(I'm pretty new to coding and a total newbie with python) When i try to check if a 'chosenLetter' is in 'randomWord' and not in the '...
0
votes
2
answers
74
views
Can an else if statement be used to create a step-wise reveal of elements with JavaScript?
Edit: Thank you! This problem is resolved. This was my first StackExchange question and you've all been very kind in responding so quickly, insightfully and thoroughly.
I'm building a page that has an ...
-4
votes
2
answers
36
views
Repeated result for if statement in python [duplicate]
token_list = ['lg', 'was', 'beaten']
defined_words = ['hand', 'leg', 'head', 'arm', 'finger', 'wrist', 'thigh']
for i in range(0, len(token_list), 1):
if token_list[i] in defined_words:
...
-1
votes
0
answers
10
views
Mark Cell as Y if 0, N is greater than 0 and cell to remain blank if no input and registered as a blank cell
I am trying to find a formula the will mark Cell as Y if 0, N if cell is greater than 0 and the cell to remain blank if there is no input in that cell
=IF(K18=0;"Y";"N") but if i ...
1
vote
1
answer
24
views
Multireplacement in .dat file lines
I have a .dat file. I want to read each line and replace a value in each line with a different value. Then save this to a new out.dat file. Every replacement is independent and I want to copy over the ...
-2
votes
1
answer
35
views
Python filter list no mater what case the letters [closed]
I am trying to figure out how to match a list value no matter whether the entered value is One, one, or oNe. I found a couple different ways but the list had to have the different possible matches. ...
0
votes
1
answer
25
views
Logical Test in Image instance
I'm working on a Power Apps application where I want to display different images based on the value of a field called 'Tipo de Ocorrência'. I am using the following formula in the Image property of an ...
-5
votes
0
answers
87
views
problem with else if statement not executing [closed]
I was practicing else if statement for a basic c course but this following part of the code isn't executing even though the syntax is correct (I'm using gedit in Ubuntu)
#include <stdio.h>
int ...
-5
votes
0
answers
22
views
How come my code is not recognising alien_colour? [duplicate]
When I run this code I dont get any output? What am I doing wrong?
alien_colour = ["red", "green"]
colours = ["red", "green", "blue", "gold",...
0
votes
1
answer
37
views
Multiple OR conditions in an AND formula
I'm trying to get a yes or no result from comparing certain items that could be the content of a cell (F2) with certain possibilities from (H2) and again from (K2).
If all the conditions are true then ...