I am so happy with freeCodeCamp that it's not for nothing, but I don't need the certificate; with what I know, I can prove that I know many things I didn't know before.

Before, I couldn't concentrate on things, I couldn't maintain focus, I couldn't solve real-life problems, I was always thinking about weird stuff. But being here, constantly learning day and night has become an addiction; I can't stop using it. I use it on my phone during my commute to and from work, I also use it at work, and I use it at home. I have to say that there are problems I've tried to solve that I've spent up to a week trying to figure out. I also got a bit ahead of myself and started learning Python, and it turns out that the FreeCodeCamp system only tracks the days you earn a point or solve one of the steps, which was discouraging because I didn't feel like I was making progress. So, I had an idea to learn HTML and CSS while also studying Python, and now my days are being counted, and let me clarify that Python has been the hardest for me. Look, I even passed the user admin certification project; after 6 days it was tough, I didn't even know where to start, and I couldn't believe I had passed that. Since then, every day I solve a problem, I get a dopamine rush of joy and motivation; nothing has motivated me as much as these courses. At first, I found their structure very complex; I still can’t believe I understand brackets, variables, indices, arguments, parameters, and many things I have learned and continue to learn. I've stopped watching movies, playing video games, and many things I used to do because this is the most entertaining and satisfying thing there is, haha. I don't know what I'm saying, I feel like I'm being weird, haha. God wanted it this way.

Can you help me with this? It says I need to print.

# ese es un problema


def validate_isbn(isbn, length):
    if len(isbn, length) == length:
        print(f'ISBN-{length} code should be {length} digits long.')
        return 
    main_digits = isbn[0:length]
    given_check_digit = isbn[length-1]
    main_digits_list = [int(digit) for digit in main_digits]
    # Calculate the check digit from other digits
    if length == 10:
        expected_check_digit = calculate_check_digit_10(main_digits_list)
    else:
        expected_check_digit = calculate_check_digit_13(main_digits_list)
    # Check if the given check digit matches with the calculated check digit
    if given_check_digit == expected_check_digit:
        print('Valid ISBN Code.')
    else:
        print('Invalid ISBN Code.')
def calculate_check_digit_10(main_digits_list):
    # Note: You don't have to fully understand the logic in this function.
    digits_sum = 0
    # Multiply each of the first 9 digits by its corresponding weight (10 to 2) and sum up the results
    for index, digit in enumerate(main_digits_list):
        digits_sum += digit * (10 - index)
    # Find the remainder of dividing the sum by 11, then subtract it from 11
    result = 11 - digits_sum % 11
    # The calculation result can range from 1 to 11.
    # If the result is 11, use 0.
    # If the result is 10, use upper case X.
    # Use the value as it is for other numbers.
    if result == 11:
        expected_check_digit = '0'
    elif result == 10:
        expected_check_digit = 'X'
    else:
        expected_check_digit = str(result)
    return expected_check_digit
def calculate_check_digit_13(main_digits_list):
    # Note: You don't have to fully understand the logic in this function.
    digits_sum = 0
    # Multiply each of the first 12 digits by 1 and 3 alternately (starting with 1), and sum up the results
    for index, digit in enumerate(main_digits_list):
        if index % 2 == 0:
            digits_sum += digit * 1
        else:
            digits_sum += digit * 3
    # Find the remainder of dividing the sum by 10, then subtract it from 10
    result = 10 - digits_sum % 10
    # The calculation result can range from 1 to 10.
    # If the result is 10, use 0.
    # Use the value as it is for other numbers.
    if result == 10:
        expected_check_digit = '0'
    else:
        expected_check_digit = str(result)
    return expected_check_digit
def main():
    try:
       user_input = input('Enter ISBN and length: ')
       values = user_input.split(',')
       isbn = values[0]
       length = int(values[1])
       if length == 10 or length == 13:
          validate_isbn(isbn, length)
    except IndexError:
        print("Enter comma-separated values.")
    except ValueError:
        print('Length must be a number.')
    except TypeError:
        print("Invalid character was found.")
        print("Valid ISBN Code.")
    except TypeError:
        print("Invalid ISBN Code.")
    


#main()
u/ricardoflak — 18 days ago

Hello, today I feel confused. It turns out that I have been learning Python for several months on FreeCodeCamp and I am working on the first certification project. It was a difficult process; I dedicated many hours to it, but to avoid getting bored, I decided to learn HTML as well, and it turns out

Hello everyone! Today I feel a bit confused. I've been learning Python for several months on freeCodeCamp and I'm currently working on the first certification project. It’s been a tough process with many hours invested, so to avoid getting burnt out, I decided to check out HTML as well.

Turns out HTML felt super easy—just today I racked up 53 completed steps in HTML! But looking back, I sometimes feel like I should have started with the web dev path (HTML, CSS, JS) before diving into Python. Now, being deep into Python while finishing up HTML, I feel like I'm competing with myself. I catch myself thinking, "Let's see which language wins today," and HTML ended up surging ahead of Python.

Am I overthinking this? Is it okay to learn HTML and Python at the same time, and was it a mistake to leave JavaScript for last? I'd love to hear your thoughts!

https://preview.redd.it/5mt8mauexjqh1.png?width=2393&format=png&auto=webp&s=ed48afdc26af178ccca2b6dea3963a992dd689fe

https://preview.redd.it/de67x38cxjqh1.png?width=2011&format=png&auto=webp&s=b6c3ddb5750aeb683cae95f299a5a1ec4bf89fdb

edt:

https://preview.redd.it/og3xuveiekqh1.png?width=1711&format=png&auto=webp&s=4cb311a3207c3ffdc908611e16edc7e71d16dbf4

reddit.com
u/ricardoflak — 25 days ago

Tengo un problema con la comprensión de listas porque no me deja entrar operadores. Para poder evaluar el keys, value en el return.

import re


medical_records = [
    {
        'patient_id': 'P1001',
        'age': 34,
        'gender': 'Female',
        'diagnosis': 'Hypertension',
        'medications': ['Lisinopril'],
        'last_visit_id': 'V2301',
    },
    {
        'patient_id': 'p1002',
        'age': 47,
        'gender': 'male',
        'diagnosis': 'Type 2 Diabetes',
        'medications': ['Metformin', 'Insulin'],
        'last_visit_id': 'v2302',
    },
    {
        'patient_id': 'P1003',
        'age': 29,
        'gender': 'female',
        'diagnosis': 'Asthma',
        'medications': ['Albuterol'],
        'last_visit_id': 'v2303',
    },
    {
        'patient_id': 'p1004',
        'age': 56,
        'gender': 'Male',
        'diagnosis': 'Chronic Back Pain',
        'medications': ['Ibuprofen', 'Physical Therapy'],
        'last_visit_id': 'V2304',
    }
]


def find_invalid_records(
    patient_id, age, gender, diagnosis, medications, last_visit_id
):
    constraints = {
        'patient_id': isinstance(patient_id, str) and re.fullmatch('p\d+', patient_id, re.IGNORECASE),
        'age': isinstance(age, int) and age >= 18,
        'gender': isinstance(gender, str) and gender.lower() in ('male', 'female'),
        'diagnosis': isinstance(diagnosis, str) or diagnosis is None,
        'medications': isinstance(medications, list) and all([isinstance(i, str) for i in medications]),
        'last_visit_id': isinstance(last_visit_id, str) and re.fullmatch('v\d+', last_visit_id,re.IGNORECASE)
    }
    return 'key, value' in constraints.items()


def validate(data):
    is_sequence = isinstance(data, (list, tuple))


    if not is_sequence:
        print('Invalid format: expected a list or tuple.')
        return False
        
    is_invalid = False
    key_set = set(
        ['patient_id', 'age', 'gender', 'diagnosis', 'medications', 'last_visit_id']
    )


    for index, dictionary in enumerate(data):
        if not isinstance(dictionary, dict):
            print(f'Invalid format: expected a dictionary at position {index}.')
            is_invalid = True


        if set(dictionary.keys()) != key_set:
            print(
                f'Invalid format: {dictionary} at position {index} has missing and/or invalid keys.'
            )
            is_invalid = True


    if is_invalid:
        return False
    print('Valid format.')
    return True


validate(medical_records)
print(find_invalid_records(**medical_records[0]))

https://preview.redd.it/lujj5su3p2qh1.png?width=1915&format=png&auto=webp&s=0ac4a0b867311b1b2d95070b3ccd621d75018e70

reddit.com
u/ricardoflak — 28 days ago

Aveses es mejor en pesar desde 0 en el mejor momento

Hoy tube problema con windows 11 y no podía iniciar así que intente varias soluciones y no pude arreglar el problema.

Tenía muchos proyectos por terminar tenía proyectos que tenía que terminar que no logré completar y etc... lo quemas me duele fueron los proyectos que casi termino de motion graphics y etc..

Pero justo hoy terminé eliminando todo fotos de recuerdos proyectos que tenía prácticamente todo mi trabajo y recuerdos de ese disco duro allí tenía todo en absoluto.

El disco duro tenía 4 años con Migo pero hoy despido todos esos archivos.

Pero me siento bien porque ahora podré tener un flujo de trabajo mejorado tendré mis archivos bien estructurado bien organizado todo.

Me siento bien y mal pero dios lo quiso así

reddit.com
u/ricardoflak — 1 month ago

I don't know what's happening, but I have a personal project, meaning I'm applying what I've learned in my own program, and I realized that I was looking for official documentation about the libraries I needed.

It turns out that FreeCodeCamp explains the library more easily than the documentation itself. How is this possible? I used to like FreeCodeCamp; now I like it twice as much as I did before.

reddit.com
u/ricardoflak — 1 month ago
▲ 1 r/learnanimation+1 crossposts

Apply some of the principles of animation in that clip, what do you think?

There are two clips: one with music and the other only with sound effects.

u/ricardoflak — 2 months ago

No sabía que cuando le aplicaba un echo a una máscara de capa a una composición el PC se en congelaba

El la mañana de hoy ice una animación de un círculo interactivo que cuando tropesaba con un texto el mismo se desplazaba suavemente asia su posición. Resulta que quise ponerme creativo y quise añadir una máscara de trazo que siguiera el circulo en movimiento y resultó bien luego le puse un echo al trazo en movimiento y configure el máscara de trazo para que se viera suave como su fuese una luz y le baje la opacidad a su segunda capa (la duplicada) pues nose que pasa resulto que la PC seme en congelo nose si fue por eso o por otras cosas que le añadí entonces al final perdí todo lo que ice y quería subirlo porque en realidad quedó muy epico.

reddit.com
u/ricardoflak — 2 months ago