Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use the built-inrandommodule and aforloop to generate 40 random numbers between -50 and 50 then display a list of only the negative numbers rounded to
Use the built-inrandommodule and aforloop to generate40random numbers between-50and50then display a list of only the negative numbers rounded to two decimal places. The program should also count the number of negative numbers and display the count. Your output should look similar to this (numbers and counts may vary):
[-43.44, -42.29, -22.71, -38.69, -18.79, -5.35, -27.01, -31.39, -22.59, -20.14, -7.81, -1.38, -33.73, -35.51, -16.85, -31.05, -16.24, -31.58, -0.47, -15.03]
There are 20 negative numbers in the list.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started