if문 tag

47 questions


1 answers
47 views
0
Is there a way to reduce the if clause in the form of if (a!=0) then aelseb...?

For example...if a > 0 then return aelse return bHow do you change this form of if clause beautifully??@Overridepublic int compareTo(Object obj) { if (this.make.compareTo(((Car) obj).getMake()) !=...

2 years ago

1 answers
94 views
0
How can split be used for things that are slightly different in form (?) from each other using split, for, etc.?

Hello, I am an introvert who has been practicing split, for, and if moon recently.df = pd.DataFrame({idx5:[ ex1.x.1, ex1.x, ex2.x.2, ex2.x.3, ex1.x.2, ex2.x, ex2.x.4, ex2.x.5, ex1.x.3, ex3.x, ex2.x.6,...

2 years ago

1 answers
88 views
0
Is there a way in Python DataFrame to store a specific value position (row or column) and a specific number of values in each variable?

Hello, I'm Python beginner who is learning Python dataframe.fori in range(len(df)) if df1.loc[i, idx1]==HELLO : cnt1=cnt1+1 num=i df2.loc[10, 'idx8'] = df.at[i,'IDX8']There's a code like this, but ...


1 answers
71 views
0
I have a question about range in the for statement!

I just started coding, so I have a question for j in range(len(list2)): for w in range(len(list2[0])): if list3[w] != list2[j][w]: new_list.append(list2[j][w])J = 0, 1 w = 0, 1, 2, 3, 4, 5We know th...

2 years ago

1 answers
45 views
0
Set common conditions for if statements

When setting the if statement condition, I would like to know if there is a way to set the common condition only once with one variable or another.If you set it as a variable, true false is set as the...

2 years ago

1 answers
55 views
0
It's a question from Python if

a = input()b = input()cnt = 0n = 0 if a[n:n + len(b)] == b:It's a grammar question, but I don't know the meaning of the last if question Did you slice a?

2 years ago

1 answers
65 views
0
It's a simple code, please help me.

for i in range(2, 21): if i == 8: print() ####Source code #### print(i, end= ' ')Output value:2 3 4 5 6 7What code should be included in #### source code#### for the output to come out like this?i[0...

2 years ago
« - 5 -

© 2024 OneMinuteCode. All rights reserved.