1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
suter [353]
2 years ago
10

Write code that generates a random odd integer (not divisible by 2) between 50 and 99 inclusive.

Computers and Technology
1 answer:
san4es73 [151]2 years ago
8 0

import random

nums = [x for x in range(50,100) if x%2!=0]

print(random.choice(nums))

We use a list comprehension to create a list of the odd numbers between 50 and 99. Then we randomly choose one of those numbers using the random module.

You might be interested in
Given a class called Measure that has the methods and data as specified, choose the correct code to satisfy the requirements of
Nina [5.8K]

Answer:

D

Explanation:

7 0
3 years ago
Can you please make a simple python program? I will give you 20 points and branliest if it is good! It must include:
alekssr [168]

Answer:

# Solve the quadratic equation ax**2 + bx + c = 0

# import complex math module

import cmath

a = 1

b = 5

c = 6

# calculate the discriminant

d = (b**2) - (4*a*c)

# find two solutions

sol1 = (-b-cmath.sqrt(d))/(2*a)

sol2 = (-b+cmath.sqrt(d))/(2*a)

print('The solution are {0} and {1}'.format(sol1,sol2))

Hope This Helps!!!

3 0
2 years ago
Read 2 more answers
Gaven's instructor told him to include a personal statement in his work portfolio. Why did his instructor recommend including a
algol [13]
The recommendation of the instructor for Gaven to include a personal statement in his work portfolio will allow him to identify his career goals. If he is unable to show this to his work portfolio then he may simply state it in the personal statement. Thus, the answer to this item is letter A. 
3 0
3 years ago
PLEASEE HELPP.... QUESTION... how does coding impact your life​
nataly862011 [7]

Answer: It allows us to do everyday tasks on the internet

Explanation: We wouldn’t be able to email, research, etc without coding!

6 0
2 years ago
Read 2 more answers
When formulating a linear programming model on a spreadsheet, the decisions to be made are located in the data cells.
Alinara [238K]
True. Gotta have 20 characters to answer
8 0
1 year ago
Other questions:
  • Describe the difference between fuses and circuit breakers. where might each type of device find its best use? g
    10·1 answer
  • _______ are unprocessed facts that a computer feeds on.
    5·1 answer
  • Create an instance of your queue that accepts java.lang.String Objects. Starting with an empty queue, use the enqueue(E e) metho
    15·1 answer
  • Assume that you have an array of integers named arr. Which of these code segments print the same results?
    15·1 answer
  • Which element is located on the top left of the Word screen?
    6·1 answer
  • Help me asap please
    15·1 answer
  • Edhesive Intro to cs quiz 2 q#9 <br><br> What is output? <br> Print (3 % 15)<br> Thanks!!
    8·1 answer
  • Why must web designers select a common font?​
    8·2 answers
  • What is output by the following line of code?
    15·1 answer
  • Types in java are divided into two categories. the primitive types are boolean, byte, char, short, int, long, float and double.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!