for tag

100 questions


1 answers
138 views
0
Python repeat statement and tuple question. Masters, please help me

I'm taking a course called the return value of a function using a tuple. I'm posting a question because I don't understand something.names = [Cheolsoo, Younghee, Youngsoo]for i in range(len(names)): n...

2 years ago

1 answers
108 views
0
Python for Moon. Question from Python for Moon!

I'm going to turn the for statement to Cf1, Cf2, Cf3, and Cf4 below! It's blocked from the beginning. Help me!Cf1 = pd.read_csv(1Y.csv)Cf1 = Cf1.dropna()Cf1.isna().sum()xy1 = np.array(Cf1, dtype=np.fl...

2 years ago

1 answers
76 views
0
Execution of a for statement within a recursive function

import java.util.ArrayList;import java.util.Scanner;public class Anagram {public static void ana(ArrayList<String> ar, ArrayList<String> sub){ if(ar.size()>1) { for(int i = 0; i < a...

2 years ago

1 answers
82 views
0
I have a question about the 4-20 repeat statement

Thank you for your answer before However, I did not learn the repetition of for of from the 4-20 repetitionAs I read the link to the lecture, I got a questionlet arr = [3, 5, 7];arr.foo = hello;for (l...

2 years ago

3 answers
109 views
0
How can I change the list element using the for statement in Python?

In Python, you want to change the element that meets the condition to a different value.temp = ['apple', 'banana', 'coke']for i in temp: if i == 'coke': i = 'grape'print(temp)I thought it would be ap...

2 years ago

1 answers
123 views
0
The for syntax and count() behave strangely in python.

data = [1,2,3,4,5,6,7,8,9,10,11,12,13,14]for i in data: if data.count(i) == 1: data.remove(i)print(data)output: [2,4,6,8,10,12,14]Why does an odd number work when I tried to erase the only value?

2 years ago

1 answers
98 views
0
I want to change the for statement from C++ to Python, but I'm not sure.

I am a student studying Python.I want to change the for statement below to Python in C, but I don't know how to change it.for (int i = 3; (i*i) <= number; i += 2) { if (number % i == 0) return fals...

2 years ago

2 answers
82 views
0
Python Briefly Expresses Long If Statements

import numpy as npimport cv2 as cvimg = cv.imread('dp.png')img_h = img.shape[0]img_w = img.shape[1]img_bpp = img.shape[2]print(img_h, img_w, img_bpp)blue = (255,0,0)white = (255,255,255)a = 450b = 0c ...

2 years ago

0 answers
70 views
0
Corinne is right about Python's for repetition and how to use continue... crying

Hello, masters Here's the question! numbers = [ (1,2),(10,0) ] for a,b in numbers: if b == 0: print(It cannot be divided by 0.) continue print({} divided by {} is {}.format(a,b,a/b))Problem: 'The ...

2 years ago

2 answers
156 views
0
How to Use For Statements Using C++ Auto

int * buff = new int[10];for(auto x : buff?? ){ x = 0;}I want to initialize all the buffs that were assigned dynamically to zero, buff?Please tell me how to write down.I tried buff[], buff, etc., but ...

« - 4 - »

© 2024 OneMinuteCode. All rights reserved.