function tag

78 questions


1 answers
82 views
0
Can't I use the function as a dictionary value?

For example,Assuming that the functions draw_nose and draw_eye are defined drawing = { 'nose' : draw_nose, 'eye' : draw_eye}Define a drawing dictionary and If I enter the key value of the dictionary, ...

2 years ago

1 answers
115 views
0
I'm asking you about the execution of other functions in the main function

I'm a beginner at Python.On the left, we specified the f function in the main If you run the main function, the f function also runs.Let's define the f function separately like the rightRunning the ma...


1 answers
58 views
0
I have a question for Python code. Two actions do not work at the same time. (Sockets, Servers, Vibration Sensors)

Hello. I use the Python cord for jjamppong, but if one works, one doesn't work... I don't know what the problem is.I don't really know Python, so I'll look for a lot of things and order jjamppongWhen ...

2 years ago

1 answers
76 views
0
C++ General Function Genericization Question.

void insert (int a, int b[], int index) { b[index] =a;}void insert (char a, char b, int index) { *(b+index) = a;}The goal is to make these two functions generalized generic functions, but I don't unde...

2 years ago

1 answers
88 views
0
append error while using a custom function

def show_df (column, new_columns = ['distinguished'], dataframe = one): df = dataframe[column].value_counts().reset_index() new_names = new_colnames new_names.append('counts') df.columns = new_names d...


1 answers
46 views
0
Python duplicate element finding function

def list_L(A,B): d=[] for i in range(A): C=B.count(A[i]) d.append(C) k=d.count(0) return True else: return FalseA=[int(x) for x in input(enter list1 elements:).split()]B=[int(x) for x in input(en...

2 years ago

1 answers
49 views
0
Can I add a function to one sentence with python(pyspark)for statement?

Original manually manipulated function df2 = df1.withColumn(test1, col(data.test1))\ .withColumn(test2, col(data.test2))\ .withColumn(test3, col(data.test3))\ .withColumn(test4, col(data.test4))\ ...

2 years ago

1 answers
56 views
0
Can the parameters of the C/C++ function be used without initialization?

#include <iostream> using namespace std;int getsum(int);int main() { int num, sum; cin >> num; sum = getsum(num); cout << sum << sum << endl;}int getsum(int value) { int...

2 years ago

1 answers
53 views
0
Can't the name of the C/C++ variable be the same as the name of the function?

#include <iostream>using namespace std;int sum(int a, int b){ return a + b;}int main() { int a , b; int sum = sum(5,6); cout << sum;}There's an error. Can't the variable name in the main f...

2 years ago

1 answers
44 views
0
A simple way to save and rewrite a data frame imported into requests.

We created a function that calls api and saves it in dataframe format as follows:I want to save the returned df value somewhere else and use it when creating another function.What's the way? I don't w...

2 years ago
« - 6 - »

© 2024 OneMinuteCode. All rights reserved.