Question: Task-Comparing numbers Python program that asks the user for two integers. Then, write three separate if/else statements as follows: If the first number is greater

Task-Comparing numbers

Python program that asks the user for two integers.

Then, write three separate if/else statements as follows:

If the first number is greater than the second, print "The first number is greater". Otherwise, print "The first number is not greater".

If the two numbers are equal print "The numbers are equal". Otherwise, print "The numbers are not equal".

If the second number is greater than the first, print "The second number is greater". Otherwise, print "The second number is not greater".

Task- Comparing Strings using literal value (hard coding)

Have the program ask the user for their favorite animal. Then write an if statement as follows:

Check to see if the user's favorite animal is the same as your favorite animal (meaning you, the programmer). If it is, print "That's my favorite animal too!" If it's not, print "That one is not my favorite." Verify that it works regardless of the capitalization.

Verify that your program works correctly by following each step in this testing procedure:

Test the first part of your program with pairs of numbers where the first is greater and also where the second is greater. Verify that all three values that are printed are correct.

Test it with two numbers that are equal. Verify that all three values that are printed are correct

Test the second part of your program with an animal that is different. Verify that the correct message is shown.

Test it with an animal that is the same. Verify that the correct message is shown.

Test it with an animal that is the same, but using different capitalization. Verify that it still matches, even with different capitalization.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!