else tag

15 questions


1 answers
112 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
129 views
0
How can I write without using an ifelse statement in Python?

x= 2000y= 3000z= 3500a = int (input (Number of Americano Sales: )))b = int (input (Café latte sales count: )))c = int (input (number of cappuccino sold: )))t = x*at = t + y*bt = t + z*cprint (Total sa...

2 years ago

1 answers
86 views
0
Introduction to C language yesterday. I have a question about if and else

I have a question about the C language-based robot programming called Lego Mind Storm Masters!You put if in else again.after executionIn the loopOperation if sensor 1 is greater than 50 Add conditions...

2 years ago

1 answers
88 views
0
When is else used at the same level as the for / while repetition statement?

for i in range(10): print(i) if i == 9: print(Too big - I'm giving up!) break;else: print(Completed successfully)I don't know why you use else when you have a code like this.At first, I thought the ...


1 answers
168 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
119 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
113 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
121 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
167 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
91 views
0
I'm working on a program using if-else-elif, but there's something I don't know.

Using elif,I'm working on a parking calculation program. I'm going to make a program like thisYou parked for a few minutes How much do you have to pay?How do I program to make it float?!

2 years ago
- 1 - »

© 2024 OneMinuteCode. All rights reserved.