Please see the below minimal example,
printbbb = True
print(f"""AAA
{'''BBB''' if printbbb else ''}
CCC""")
This prints
AAA
BBB
CCC
as desired, however, if I set printbbb to False, it prints
AAA
CCC
How can I change the code so that it will print
AAA
CCC
when printbbb is set to False?