Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Having trouble with this Python code! Please leave comments before each function explaining all parameters. Please help! Thank you! Program Specifications Write a program that

Having trouble with this Python code! Please leave comments before each function explaining all parameters. Please help! Thank you!image text in transcribed

Program Specifications Write a program that asks the user for a number. The program then prints some properties of the number, whether it is an even or odd number and whether it is a negative or non-negative number. Sample runs In this sample run, the user input is 1 Enter a number: 1 The number you entered is an odd number. The number you entered is a non-negative number. In this sample run, the user input is -2 Enter a number: -2 The number you entered is an even number. The number you entered is a negative number. Required program decomposition You are required to include the following functions in your program. check_even_odd(num) This function accepts a number and returns the string even or odd based on the value of the num parameter. check_neg_nonneg (num) This function accepts a number and returns the string negative or non-negative based on the value of the num parameter. Notes The functions check_even_odd and check_neg_nonneg donot print anything, but instead the return a string. You must make calls to these two functions in the main function. The printing of the properties of the number inputted by the user should be done in the main function. That is, the print statements should be in the main function. All your statements must be part of one of the functions described above (including the main function)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems 6th Asian Conference Aciids 2014 Bangkok Thailand April 7 9 2014 Proceedings Part I 9 2014 Proceedings Part 1 Lnai 8397

Authors: Ngoc-Thanh Nguyen ,Boonwat Attachoo ,Bogdan Trawinski ,Kulwadee Somboonviwat

2014th Edition

3319054759, 978-3319054759

Students also viewed these Databases questions