@robertpreston0601364 posted a new topic, subject "How do I change labels for a column of data with list comprehension?". It read:

   I am attempting to mark each dog that has surpassed the age of 100, in human years, as “Dead”, but I don't know the correct syntax and am therefore rewarded with a syntax error.
    
    I have played around with parentheses and brackets, but to no avail.
    
    Any help is much appreciated and thank you in advance 
    [code] 
        human_years = [4, 6, 9, 12, 14, 24, 30]
        
        dog_years = [age * 7 if (age * 7) <= 100 else age = "Dead" for age in human_years]
        
        print(dog_years)
        
    [/code]

To which @stetim94 replied

    the else:
    [code] 
        else age = "Dead"
        
    [/code]
    
    not sure why you use assignment? You can simplify specify the value you want appended to the list

Then @robertpreston0601364 said

    So simple! 
    
    I'm new to Python and was completely overthinking it.
    
    Thank you so much for the response.


{'source': 'discourse', 'url': 'https://discuss.codecademy.com/t/how-do-i-change-labels-for-a-column-of-data-with-list-comprehension/643450', 'title': 'How do I change labels for a column of data with list comprehension?', 'views': 187, 'has_accepted_answer': False, 'word_count': 125, 'like_count': 0, 'reply_count': 1, 'participant_count': 2, 'posts': 3, 'tags': 'general python-syntax', 'author': '@robertpreston0601364', 'participants': '@robertpreston0601364, @stetim94', 'image_url': [None], 'created_at': '2022-01-14T14:30:08.254Z', 'last_posted_at': '2022-01-14T17:47:54.159Z'}