def tag

20 questions


1 answers
347 views
0
Question about __init__ method

#1 First Methodclass Triangle(object): def area(self, b, h): self.b = b self.h = h return b*h/2a = Triangle()a.area(4,8)I tried to write down the code above using the init method.#2 Try the second ...

1 years ago

1 answers
119 views
0
The difference between "structure" and "typedef structure"

What's the difference between these two in C++?Most of them use the second methodWhy is that?

1 years ago

1 answers
125 views
0
uint8_t and unsigned char difference

As far as I know, uint8_t is unsigned char and typeefI understand that the implementation of the two is the same.I think there's a reason why they made it separatelyI wonder when uint8_t is used

1 years ago

1 answers
92 views
0
What does it mean if an argument has a colon when defining a function?

I'm playing with checkiO and the function presented is It also says def data (password: str): It also says def data (password: str) -> str:I'm just a beginner at Python, so I only know that you spe...


1 answers
107 views
0
I'm asking you a question while studying Python commands.

I don't know what to do with Python, so I was studying the def syntax, and I asked because I had a question.The contents below are what I did.Questions Is there a way to use the def phrase as a plural...

1 years ago

1 answers
85 views
0
Unsupported operation type(s) for &: 'str' and 'tuple' are not allowed

I wrote these programs. # Determining the root of a quadratic equationdef discriminant(secterm, priterm, constant): discrinum = priterm * priterm - 4 * secterm * constant if discrinum > 0 : result...

1 years ago

4 answers
72 views
0
Python's 2D list. I have a question.

Hello, I'm going to create a function that takes the mean from the list in the list. grades = [ ['Student', 'Quiz 1', 'Quiz 2', 'Quiz 3'], ['Joe', 100, 90, 80], ['McD', 88, 99, 111], ['Ruta', ...

1 years ago

1 answers
78 views
0
How do I type the template?

template<size_t N, size_t M>class Matrix { // ....};When you have this code If you set default parameter in the function, you don't have to write it separately when you call ittypedef Matrix<...

1 years ago

1 answers
133 views
0
To delete none after using def statement in Python

n = input('Enter string:')n = n.lower()n = n.replace(' ','')n = n.replace('',' ')n = n.strip()L = n.split(' ')S = set(L)X = list(S)k = len(X)def moonchk(n) : for i in range(0,k): a = X[i] print(a, '...

1 years ago

1 answers
125 views
0
[Python] I want to change the while statement to def.

I want to use the while statement below as a def function, what should I do? i = 0while True: i += 1 if i > 5: break print('*'*i)And I want to center the result value here. print({0:^30}('*'*i))...

1 years ago
- 1 - »

© 2024 OneMinuteCode. All rights reserved.