function tag

78 questions


1 answers
150 views
0
To have a function output its own name without a traceback module

How do you get a function to output its own name without a traceback module?For example, when the module foo has a bar function, in foo.bar() you would like to print bar is your name bar or foo.bar.Wh...


1 answers
80 views
0
Python Beginner Voting Program Project

I tried to get the number of votes, use the repetitive sentence, use the number of votes, put the symbols i, put the letters on the list, show the voting list, ask what your choice is, and show you wh...

2 years ago

1 answers
54 views
0
To save a function's name as a string?

Is there a way to save the name of a function as a string in a Python script?How do I implement get_functionion_name_as_string() in the source code below?def my_function(): passprint get_functionion_n...

2 years ago

1 answers
43 views
0
I'm practicing the item calculation code.

Here's the condition.(The price of the item is given in advance.)So the code I wrote now is ## Current amountpres_money=5000 ## the price of goodsgoods_price = {'apple':1500, 'egg':2000, 'mackerel':33...

2 years ago

1 answers
74 views
0
Python factor delivery question

defis_product_availability_matrix(matrix_a, matrix_b): row_a = [row for row in matrix_a] column_b = [column for column in zip(*matrix_b)] if(len(row_a) == len(column_b)): result = True else: result ...

2 years ago

1 answers
50 views
0
Can I make a function like string find (string number1, string number2) in c++?

In c++, string find (string num1, string num2)I'm going to make a function called find, but can I use the return type as a string?

2 years ago

1 answers
118 views
0
[javascript] Question when taking function as a factor, foo()()

Hello. I have a question while studying Closer. The function below does not originally have foo()() and contains annotated parts. When I tried foo()(), it printed well. var color = 'red';function foo(...


1 answers
124 views
0
Question about function pointer using typeef

Hello.You can study function pointers using typeef.As I studied the usage example, there is a source like below.What I'm curious about is what is the return data type of the abc function?And return (t...


1 answers
114 views
0
Is there a rule when naming variables/functions in Python?

In C#, when naming variables/functions, there were implicit rules such as CamelCase and PascalCaseI wonder if Python also has this rule.string thisIsMyVariable = apublic void ThisIsMyMethod()this_is_m...


2 answers
117 views
0
Problems initializing variables defined by existing functions when module is being imported

NameError: name 'a' is not definedp1.py file and made for UI using tkinterp1.py has a file p2.py to run via command.The ultimate goal is to read the file path of a file from the p2.py file.First, in p...

« - 4 - »

© 2024 OneMinuteCode. All rights reserved.