logo

Crowdly

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

✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.

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.')

Більше питань подібних до цього

Хочете миттєвий доступ до всіх перевірених відповідей на moodle.nottingham.ac.uk?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!

Browser

Додати до Chrome