Checkpoint 5.10.1.
What is the best set of conditonal statements provided based on the following prompt? You want to keep track of all the words that have the letter ‘t’ and in a separate variable you want to keep track of all the words that have the letter ‘z’ in them.
- If statement - Else statement
- Using if/else either uses an unnecessary else statement or would improperly keep track of one of the accumulator variables.
- If statement - Elif statement
- Using if/elif means that words that have both a "t" and a "z" would not be propperly counted by the two variables.
- If statement - If statement
- Yes, two if statements will keep track of - and properly update - the two different accumulator variables.
- If statement - Elif statemenet - Else statement
- Using if/elif/else here will provide an unnecessary else statement and improperly update one of the accumulator variables in the case where a word has both a "t" and a "z".