logo

Crowdly

The following are possible solutions to answer Question (b).  (A) Choos...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

The following are possible solutions to answer Question (b). 

(A) Choose ONE of the if-else structure (sample code) below and explain whether it would work without any errors. 

(B) Use the AND operator in the condition and modify the code to display the correct output.

Sample Code 1

if age>=18 and age<=120:

    print('Age should be in the range of 18 to 120.')

else:

     print('You may proceed with the program')

Sample Code 2 

if age <=18 and age >=120:

    print('Age should be in the range of 18 to 120')

else:

    print('You may proceed with the program')

Sample Code 3

if age < 18 and  age > 120:

    print('Age should be in the range of 18 to 120.')

else:

    print('You may proceed with the program')

Sample Code 4 

if age < 18 and  age > 120:

    print('You may proceed with the program')

else:

    print('Age should be in the range of 18 to 120.')

More questions like this

Want instant access to all verified answers on moodle.nottingham.ac.uk?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!