if-else tag

11 questions


1 answers
119 views
0
How to write an if-else statement in one line

if count == N: count = 0else: count = N + 1Is there any way to write this code in one line?In object-C, count = count == N ? 0 : count + 1;We could have shared it, but I don't know exactly what that i...

2 years ago

1 answers
182 views
0
Use Python conditional if

Enter a formula (*for example, 20*40): 21.1 + 30.021.100000 + 30.000000 = 51.100000a,b=input (Enter a formula (*for example, 20*40):)split()I know how to write an input function in this form, but I do...

2 years ago

1 answers
131 views
0
I have a question for Python if.

per1=25per2 = .75if row[23] == 'sale1' or row[23] == 'sale2': if row[27].find(per1) == -1: cursor.execute(sql)else: cursor.execute(sql)Or per2 = .75if row[23] == 'sale1' or row[23] == 'sale2': if row...

2 years ago

1 answers
122 views
0
JavaScript if-else question

It's a size output statement based on the number. I don't know why S is output when M should be output ㅠ

2 years ago

1 answers
134 views
0
I would like to inquire about JavaScript return.

<script>function showMovie(age) { //Exit if checkAge return value is false if (!checkAge(age)) { return alert ('Error'); //The return value of checkAge is true } } else { alert('movie screen...

2 years ago

1 answers
180 views
0
Check while statement string comparison conditions

int main(void){ char* str[7] = { tiger, applemango, pear, anteater, strawberry, eagle, end }; char* st = malloc(sizeof(char)*4); while (*st != end) { printf (Search word (end) : ); scanf(%s, st); f...

2 years ago

1 answers
117 views
0
c language ifelse statement question

This is a question that enters three integers and indicates whether each integer is even or odd. int a, b,c; scanf_s(%d%d%d, &a,&b,&c); if (a % 2 == 0) { printf(%s\n, even); } else if (a ...

2 years ago

1 answers
103 views
0
Ifelse statement A simple question.

age = int(Enter your age)if age >= 20: print('you are adult')elif age >=10 or age < 20: print('you are adolescent')elif age < 10: print('you are baby')I made the code like this, but even ...

2 years ago

2 answers
99 views
0
Program Python that outputs by adding both odd values between two numbers

How should the condition extraction be written in a program that takes two numbers and outputs both odd values between them? I'm trying to study alone, but I'm not sure, so I post a question.

2 years ago

2 answers
139 views
0
Function execution

a = float(Enter the required amount:)c = float(Enter the conversion factor: )))def ZEB(): n = print(a * c) if n < 80: print (Grade is A) elif 80 <= n < 140: print (Grade B) elif n >= 14...

2 years ago
- 1 - »

© 2024 OneMinuteCode. All rights reserved.