About 813,000 results
Open links in new tab
  1. python - Loop Table using distance = speed * time - Stack Overflow

    Sep 30, 2017 · Write a program that asks the user for the speed of a vehicle (in miles per hour) and how many hours it has traveled. The program should then use a loop to display the distance the vehicle has traveled for each hour of that time period.

  2. python speed calculation optimisation - Stack Overflow

    Aug 17, 2022 · I have a script with two lists. One list has measured distances and the other has spend time. I then calculate max speed ether at certain distances or for certain time window. For example I calculate max speed in two seconds period, 10s period.... and …

  3. Displaying calculations using a loop in Python - Stack Overflow

    Jul 19, 2018 · I am trying to write code that takes user input on the speed and travel time of a vehicle. Using this info the total distance per hour is calculated. A sample of the desired output if the user ente...

  4. 13 Ways To Speedup Python Loops With Minimal Effort

    Dec 31, 2023 · In this article, I cover a few simple ways to achieve 1.3x to 970x speedup of Python for loops with minimal effort. I have included code snippets for baseline and improved versions of the...

  5. If You Have Slow Loops in Python, You Can Fix It…Until You Can‘t

    Dec 8, 2024 · As Python programmers, we often find ourselves needing to speed up code containing slow loops. There are several optimization techniques we can try – built-in functions, libraries like NumPy, or lower-level languages like C.

  6. Faster Python Loops with Numba Jit - CodeArmo

    Learn how to achieve significant speed-ups in Python loops using numba's just in time compilation. In this article we give an example using pure python and numba to calculate the Mandelbrot set. We also give a brief overview on the most …

  7. Python/Time, Distance, and Speed - Wikiversity

    Jan 18, 2025 · This piece of code can calculate the total distance, time and speed. If you run the code you first enter the values such as the total speed of a car, the time it took and the distance traveled. For example, if you want to find the speed you would enter:

  8. Speed sensor calculation using Python - Raspberry Pi Forums

    Jun 14, 2016 · There are 2 methods for calculating speed using Python. The first method is using "pre-defined interval". The second method is using "calculated interval". Before we dive straight into the code let me show you the setup of this project. What we need are RaspberryPi, hall effect sensor or reed switch and small magnet.

  9. Calculate Speed in Python - CodePal

    Learn how to calculate speed in kilometers per hour using Python. This Python code takes the track distance in meters and the last lap time in seconds as input and outputs the speed in kilometers per hour.

  10. How to efficiently calculate velocity from position data stored in …

    Aug 12, 2022 · I am new to python and would like to know how I can efficiently calculate the velocity from a list within a list. I have a variable x_pos that contains the positions of 6 different people sampled at 10000 points in time. The timestep between all samples is constant = 0.1s. Running the following code thus returns the answer 6: print(len(x_pos))

  11. Some results have been removed
Refresh