Question

HI HOW DO I USE THE RANDOM FUNCTION IN MY CODE TO GET RANDOM NUMBERS OF...

HI HOW DO I USE THE RANDOM FUNCTION IN MY CODE TO GET RANDOM NUMBERS OF DRAWING RANGING FROM 3-6. i am a little confuse because inuse random function for heighet and size and it worked but i get just one output instead of 4 or 3 or 5 depending on the time i run the code sinces its random.

Homework Answers

Answer #1

I am wiritng the python code. If you will run this code you will get different output each time. The output will range between 3 and 6.

Code:
import random
num = random.randint(3, 6)
print("Random integer: ", num)

Output 1:

Output 2:

Output 3:

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Hello Expert, I am stuck on this assignment and can't get my code to run. I...
Hello Expert, I am stuck on this assignment and can't get my code to run. I would really appreciate it if anyone can help me. Assignment Requirements: Your software development company wants to continue developing and enhancing a software for internal use. For this week's assignment, it is required to read from a JSON application file (data.json) containing employee information. You will not use LINQ for this task. Your tasks include: Convert the previously created data.txt file into a JSON...
Hi, I want you get a clear and short opinion about the question is below. Please...
Hi, I want you get a clear and short opinion about the question is below. Please try to give me clean opinion so I can understand the case and if you can provide me the explanation with a different example I will be happy about it. Thank you very much for the time that you will be spending on this question. Peace! When biofuels like ethanol started to be encouraged, many farmers expected high returns because of increased demand for...
How do I get this portion of my List Iterator code to work? This is a...
How do I get this portion of my List Iterator code to work? This is a portion of the code in the AddressBookApp that I need to work. Currently it stops at Person not found and if it makes it to the else it gives me this Exception in thread "main" java.lang.NullPointerException    at AddressBookApp.main(AddressBookApp.java:36) iter.reset(); Person findPerson = iter.findLastname("Duck"); if (findPerson == null) System.out.println("Person not found."); else findPerson.displayEntry(); findPerson = iter.findLastname("Duck"); if (findPerson == null) { System.out.println("Person not found.");...
Hi, I need this program written in Java for my intro CS class. Thank you in...
Hi, I need this program written in Java for my intro CS class. Thank you in advance. (also here is the description given in class for the code) Write a program that displays all the leap years, ten per line, from 101 to 2100, separated by exactly one space. Also display the number of leap years in this period. - You should use the method isLeap which returns "true" if the year is a leap year, otherwise it should return...
I am just looking for someone to confirm my answers to these questions: 1. Assume that...
I am just looking for someone to confirm my answers to these questions: 1. Assume that the economy is in long-run equilibrium, then the price of fuel decreases. What happens to GDP, price level, and unemployment?       I got the price will decrease, unemployment will decrease, and gdp will increase 2. Asumme that the economy is in long-run equilibrium, then the DOW jones stock market increases. What happens to GDP, price level, and unemployment?       Since its a shift in...
Hello, I feel like I am super close but I can not figure out why my...
Hello, I feel like I am super close but I can not figure out why my C++ code it not displaying the proper medium. Thank you! Here is an example of the output: Input : a[] = {1, 3, 4, 2, 6, 5, 8, 7} Output : Mean = 4.5 Median = 4.5 Code so far:   #include <iostream> using namespace std; int main() { int a[100]; int n,i,sum=0; float mean, medium; //read array size // read array cout<<"Enter array size:...
How do I get the P value for this problem? ... In a General Social Survey,...
How do I get the P value for this problem? ... In a General Social Survey, respondents working full time or part time reported how many hours they worked in the previous week at all jobs. The random sample of 1,729 produced a mean of 41.8 hours with a standard deviation of 14.6 hours. Using these data what would you conclude in a test of the following hypothesis? Ho: M = 40 hours Ha: M > 40 hours The teacher...
If you do not have a graphing calculator or don't know how to use your graphing...
If you do not have a graphing calculator or don't know how to use your graphing calculator just number 14 slips of paper withe the numbers 1 thorough 14 and select the required samples from them. Obtain a simple random sample of size 5 from the Pacific 12 Conference. Use 1 as the seed. Just list the numbers your calculator generated and the corresponding teams. When I did this on my calculator, the number 9 appeared twice, so I only...
I quit social media for 1 month -- it was the best choice I ever made...
I quit social media for 1 month -- it was the best choice I ever made I quit social media for a month. So, I quit Facebook, Instagram, Snapchat, and Twitter. I just needed a break. It was time to cut myself off I stopped using social media this morning and my brain is going crazy. I just realised how often I glance down just to see if I have a notification. When I wake up in the morning, on...
No matter what I do I cannot get this code to compile. I am using Visual...
No matter what I do I cannot get this code to compile. I am using Visual Studio 2015. Please help me because I must be doing something wrong. Here is the code just get it to compile please. Please provide a screenshot of the compiled code because I keep getting responses with just code and it still has errors when I copy it into VS 2015: #include <iostream> #include <conio.h> #include <stdio.h> #include <vector> using namespace std; class addressbook {...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT