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...
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 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...
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...
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 {...
what are the four stages of the cardiac cycle: Include the Blood Pressure Numbers during the...
what are the four stages of the cardiac cycle: Include the Blood Pressure Numbers during the phases. At what point is hypertension diagnosed? At what phase will we feel the systemic pulse. What does an abnormal ECG look like and what pathology is it indicative of (there are many just select one)? List four risk factors and one comorbidity. Long term hypertension may lead to what structural changes in the heart? I order to maintain my own health and not...
Binary Search Tree with multiple structs? Hi, I am having an issue with trying to create...
Binary Search Tree with multiple structs? Hi, I am having an issue with trying to create a binary search tree while having multiple structs. The struct code provided is provided for us. #define CAT_NAME_LEN 25 #define APP_NAME_LEN 50 #define VERSION_LEN 10 #define UNIT_SIZE 3 struct app_info{ char category[CAT_NAME_LEN]; // name of category char app_name[APP_NAME_LEN]; // name of application char version[VERSION_LEN]; // version number float size; // size of application char units[UNIT_SIZE]; // GB or MB float price; // price in...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT