D
D
Daniil Kotlyar2021-03-21 17:21:38
IT education
Daniil Kotlyar, 2021-03-21 17:21:38

Why is learning progressing so slowly?

Good afternoon. My question is not about any features or fundamentals. Just tell me how to be in such a situation, what to do, or maybe it's better to leave everything and the programming is not mine.

I have been actively learning Python for about a month every day. And I love it! I know the basics: I can solve elementary tasks, write functions, cycles, I understand what lazy evaluation is. It even seems to be good for learning. But here I am faced with a task that I do not understand how to solve. The task was to make a function that would replace Arabic numbers with similar Roman ones. And here's the problem. I can't figure out how to solve this problem. That is, I know all the basics, but I can’t put the puzzle together. For my head, this is a difficult task. I sat for a long time when I already saw the solution to this problem - it was still difficult to understand how people thought of this. I had assumptions, but I came across something that I don’t know yet and I skidded. So, please tell me, is this misunderstanding normal, or is my head not ready for this? Thank you.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
S
Sergey Gornostaev, 2021-03-21
@Daibend

Did you expect instant results? A month is very short. For a month, even a textbook for beginners is not normally studied. It takes a lot more time to train the brain. The starting level, sufficient for hiring, is developed for six months or a year. A couple of years of practice surrounded by professionals is needed to grow into the middle. And the process never stops, the more you train, the greater the range of tasks you can solve and the easier it is for you. Keep trying, everything will come with due perseverance.

V
Vladimir, 2021-03-21
@AstraVlad

I may not be a programmer by profession, but there is one thing that I can say for sure: in programming, the main thing is not learning programming languages. A program is an algorithm written in a machine-readable language. Knowing a programming language allows you to write a program, but if you do not have an algorithm, you will have nothing to write. Therefore, the most important thing is to learn to think algorithmically, that is, to begin to decompose the task in your mind into a sequence of interrelated actions that will always, guaranteed, lead you to the desired result. To begin with, you can simply write down this sequence in ordinary Russian on paper and go through it yourself, trying to complete it step by step. And only then try to write "in a machine-readable language."
Once the discipline of the mind is developed, the rest becomes much easier. And it will become completely unimportant in what language to write your algorithm.

V
Vladimir Korotenko, 2021-03-21
@firedragon

Learn algorithms. More precisely, even teach how to formalize the task. First things first, find how Arabic is translated into Roman, then describe everything in the code.

A
Alexander, 2021-03-21
@sanya84

Use a dictionary.

roman = {1: 'I', 2: 'II', 3: 'III', 4: 'IV', 5: 'V'}
arabic = {'I': 1, 'II': 2, 'III': 3, 'IV': 4, 'V': 5}


class Numbers:
    @staticmethod
    def to_roman(integer: int)->str:
        return roman[integer]
    @staticmethod
    def to_arabic(string: str)->int:
        return arabic[string]


def test():
    print(Numbers.to_arabic('V'))
    print(Numbers.to_roman(3))

if __name__ == '__main__':
    test()

A
Antonio Solo, 2021-03-21
@solotony

in fact, you just need to KNOW the algorithm for transferring from the Arabic system to the Roman one. and when you know, then encode ....

A = (1, 4, 5, 9, 10, 40, 50, 90, 100, 400, 500, 900, 1000)
L = ('I', 'IV', 'V', 'IX', 'X', 'XL', 'L', 'XC', 'C', 'CD', 'D', 'CM', 'M')
def a2l(x):
    r = ''
    k = len(A)
    while k >= 0:
        while x >= A[k]:
            r += L[k]
            x -= A[k]
        k -= 1
    return r

Is this misunderstanding normal, or is my head not ready for this? Thank you.

fine. train. and remember that there is a rule "10000 hours".

S
Saboteur, 2021-03-22
@saboteur_kiev

It is not very clear whether you finished school, but the question is how many years did you study mathematics at school, and did you become a mathematician?
How many years did you study English at school, and can you now communicate with an Englishman in English?
How many years did you teach "anything" at school and did you become a specialist?
And then you study for about a month, and you think that this is enough to solve any problems?
Think, search, look at other people's solutions and try to understand them and rewrite them in your own way. And spend more time and more effort on it.
And not yours - this is if you are not very interested in doing this, because motivation must come from within.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question