Write a Python program that reads in 3 digits and prints "in order" if they are sorted in ascending or descending order. Otherwise, prints “not in order". For example:

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 22PE
icon
Related questions
Question
Write a problem,output,input, algorithm,comment and design a program.
Exercise 4:
Write a Python program that reads in 3 digits and prints "in order" if they are sorted in
ascending or descending order. Otherwise, prints "“not in order". For example:
Please enter 3 digits: 1 3 6
136 **in order**
Please enter 3 digits: 9 4 1
941 **in order**
Please enter 3 digits: 8 5 7
857 **not in order**
Please enter 3 digits: 4 4 2
44 2 **in order**
Transcribed Image Text:Exercise 4: Write a Python program that reads in 3 digits and prints "in order" if they are sorted in ascending or descending order. Otherwise, prints "“not in order". For example: Please enter 3 digits: 1 3 6 136 **in order** Please enter 3 digits: 9 4 1 941 **in order** Please enter 3 digits: 8 5 7 857 **not in order** Please enter 3 digits: 4 4 2 44 2 **in order**
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Module hierarchy chart
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning