756 Answered Questions for the topic Python
Python
03/08/21
python weather question
Write a program that will ask the user if they want to enter Fahrenheit (or f or F) or Celsius (or c or C) - you must allow all variations shown here for this input. Then it will ask the user to...
more
Python
03/07/21
While_Loops_Lab_2
Create a while loop with 100 iterations. The program determines if the index is even or odd by writing an IF statement in the body of the loop.
If the index is even print(“index even”, index...
more
Python
03/07/21
Python while loops lab
These exercises are the same as the For Loop lab. This lab requires you to convert the for loops into while loops:
Create a while loop with 100 iterations. The program determines if the index is...
more
Python
03/05/21
python programming
Which of the following statements is false?
Normally, the arithmetic operations on arrays require as operands two arrays of the same size and shape.
When one operand is a single...
more
Python
03/05/21
python programming
Which of the following statements a), b) or c) is false?
The following code uses the random module’s randrange function with a list comprehension to create a list of six million die...
more
Python
03/05/21
python programming
Which of the following statements is true with respect to displaying an array of 1000 items or more?
NumPy always drops the middle rows and middle columns from the output.
NumPy...
more
Python
03/05/21
python programming
Which of the following statements about NumPy’s linspace function is false?
You can produce evenly spaced floating-point ranges with linspace.
The function’s first two arguments...
more
Python
03/05/21
python programming
Which of the following statements a), b) or c) is false?
NumPy provides functions zeros, ones and full for creating arrays containing 0s, 1s or a specified value, respectively.
The...
more
Python
03/05/21
python programming
Assume the following array definitions:import numpy as np integers = np.array([[1, 2, 3], [4, 5, 6]]) floats = np.array([0.0, 0.1, 0.2, 0.3, 0.4])Which of the following statements a),...
more
Python
03/05/21
python programming
The NumPy array function receives as an argument an array or other collection of elements and returns a new array containing the argument’s elements. Based on the...
more
Python
03/04/21
Loops_Reading_3.5
Translate the following for loops to equivalent while loops.
a. for count in range(100):
print count b. for count in range(1,...
more
03/04/21
PYTHON: How to scale color channels of an imported image to find the area fraction within certain indices (see below)?
Question 1.2: Scale the red channel by 150 C, the green channel by 90 C, and the blue channel by 40 C. Add the contribution of each channel to compute the resulting temperature. Calculate the area...
more
Python
03/04/21
python question
Note: Their are no inputs in these exercises.
Create a for loop with 100 iterations. The program determines if the index is even or odd by writing an IF statement in the body of the loop.
If the...
more
Python
03/02/21
Loop 3.5 questions
Note: they use xrange in the book we will use range
Translate the following for loops to equivalent while loops.
a. for count in range(100):
print count b....
more
Python
03/02/21
for loop question
Note: Their are no inputs in these exercises.
Create a for loop with 100 iterations. The program determines if the index is even or odd by writing an IF statement in the body of the loop.
If the...
more
Python
02/26/21
Help with these questions
1. Assume that the variable amount refers to 24.325. Write the outputs of the following statements: a. print “Your salary is $%0.2f” % amount b. print “The area is %0.1f” %...
more
Python
02/25/21
How to answer these questions
Chapter 3, Section 3.1 for LoopNote: they use xrange in the book we will use rangeReading 3.1, Exercises 3.1
Write the outputs of the following...
more
Python
02/23/21
Conditionals_Lab_7
The cost of renting a room at a hotel is, say $100.00 per night. For special occasions, such as a wedding or conference, the hotel offers a special discount as follows:
If the number of rooms...
more
Python
02/23/21
Simple Code nothing complex
The cost of renting a room at a hotel is, say $100.00 per night. For special occasions, such as a wedding or conference, the hotel offers a special discount as follows:
If the number of rooms...
more
Python
02/22/21
Conditionals_Lab_6
A new author is in the process of negotiating a contract for new romance novel. The publisher is offering three options.
Option one, the author is paid $5,000 upon delivery of the final manuscript...
more
Python
02/22/21
Simple code please
A new author is in the process of negotiating a contract for new romance novel. The publisher is offering three options.
Option one, the author is paid $5,000 upon delivery of the final manuscript...
more
Python
02/21/21
Help me write a python code
Write a program that reads three decimal numbers and then calculates the average. Do not round the original values during the calculation.
Print the three numbers with one decimal place, in a...
more
02/21/21
Monte Carlo Coin Simulation
There are 30 coins. While 29 of them are fair, 1 of them flips heads with probability 60%. You flip all 30 coins 100 times. Use the Monte Carlo method to compute within .1% the probability that the...
more
Python Math
02/21/21
Monte Carlo Method question
You receive one of five distinct coupons uniformily at random each day. Use the Monte Carlo Method to estimate to within .01 days, the expected number of days until you collect two copies of each...
more
Python
02/20/21
how do I get the final answer to 2 decimal places
this is what I have so far x1 = input ("Enter coordinates for x1: ")x1 = float (x1)y1 = input ("Enter coordinates for y1: ")y1 = float (y1)x2 = input ("Enter coordinates for x2: ")x2 = float (x2)y2...
more
Still looking for help? Get the right answer, fast.
Ask a question for free
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Find an Online Tutor Now
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.