Ask Question

Write a conditional with an 'if' and an 'else': - The 'if' should check if the variable 'subj_age' has the value ''old'' (a string). - If so, it should set the variable 'change_analysis' to the value 'True' (a boolean) - Else, the variable 'change_analysis' should be set to False (a boolean)

+5
Answers (1)
  1. 23 August, 14:25
    0
    subj_age = "old"

    if subj_age = = "old":

    change_analysis = True

    else:

    change_analysis = False

    print (change_analysis)

    Explanation:

    * The code is in Python

    Initialize the subj_age variable

    Check if subj_age is equal to "old". If it is, set change_analysis as true.

    Otherwise, set change_analysis as false

    Print the change_analysis
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write a conditional with an 'if' and an 'else': - The 'if' should check if the variable 'subj_age' has the value ''old'' (a string). - If ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers