Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

uestion 2 (4 points): Purpose: To practice module and simple conditionals Degree of Difficulty: Easy For this question, you'll write a simple program that checks

image text in transcribed
uestion 2 (4 points): Purpose: To practice module and simple conditionals Degree of Difficulty: Easy For this question, you'll write a simple program that checks whether a randomly generated integer is a positive number, a negative number, or a zero. First. your program should call a random integer function randint() in the module of random and generate a random number between - 100 and 100 (range limits both included). and print out the value of this random number to console. Your program should then determine whether this random integer is greater than 0 , equal to zero or less than zero. If it is greater than 0 , it is a positive number; if it is less than 0 . it is a negative number; otherwise, it is a zero. Finally. your program should print out which kind this random integer is - a positive number, a negative number, or a zero. Sample Run Sample output (output value of a variable is shown in blue text): The random integer generated 1s:38 The random number 38 is positivel What to Hand In - A file called a2q2v1.py containing your finished program, as described above. The version number (v1) portion of the file names must be changed to v2, v3 etc. each time you resubmit your assignment. Remember to include all your solution files each time you submit/resubmit your assignment

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part I Lnai 8724

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448475, 978-3662448472

More Books

Students also viewed these Databases questions

Question

What should a government do to stop a hyperinflation?

Answered: 1 week ago

Question

8. Demonstrate aspects of assessing group performance

Answered: 1 week ago