Question: 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

 uestion 2 (4 points): Purpose: To practice module and simple conditionals

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

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!