[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

could someone show me the best way to do this. im using python.

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 19
Thread images: 1

File: python-programming-language.png (126KB, 600x600px) Image search: [Google]
python-programming-language.png
126KB, 600x600px
could someone show me the best way to do this.

im using python.

"Create a program that takes a time for a car going past a speed camera, the time going past the next one and the distance between them to calculate the average speed for the car in mph. The Cameras are one mile apart."

Any help is appreciated
>>
Get someone else to do your homework
>>
>>51470498
im not looking for an answer, im looking for help in how to do this.
>>
you have

two measurements one mile apart
time at first marker and second

you need speed in mph


please god don't be this retarded anon
>>
Speed = distance / time
>>
>>51470529
i very new to programming sorry

however this is helpful, much thanks
>>
>>51470514
Then you aren't asking a programming question, you are asking for an algorithm to calculate speed. You belong on >>>/sci/. Or even better, since you could answer that question with middle school physics: you belong on >>>/reddit/
>>
>>51470561
i understand the physics behind it.

the problem i have is translating that into a prgram
>>
>>51470639
Then you are really missing the basics, since that is one of the easiest things to program. You're given two times as arguments, calculate the speed. Look up a Python tutorial before asking to be spoonfed.
>>
>>51470639
I don't think you do buddy.

Speed = 1 mile/(time2 - time1)

That's the physics of it, and it's almost already in python.
>>
Step 1:
> Learn the language of the photogates

Step 2:
> Spend many years gaining their trust

Step 3:
> Impregnate the alpha female

Step 4:
> Speak to the gestating child every day and repeat its instructions: "take the time for a car to pass through two photogates, the distance between said photogates, and calculate the average speed of the car in mph."

Step 6:
> Congratulations, your new photogate child can solve all of your problems for you. And, you were one great father. Well done, anon.

Well done, indeed.
>>
> Cars speed at cam 1 and cam 2
Are these supposed to be user input values?
>>
>>51470875
I meant time
>>
>>51470483
>takes ... the distance between them
>cameras are one mile apart
why?
>>
OP youre taking too long so ill do your hw for you.

Cam1 = input (" enter time at cam 1 \n")
Cam2 = ...

Time = Cam2 - Cam1

Miles / Time (in hours).

In your case miles should be hard coded to 1
>>
>>51470639
write down the equation. configure it to take input. there you fucking go you dingus
>>
You need to be 18 to use this site.
>>
>>51470483
It's basic pre-alegbra... As for the python part look up a python tutorial for literally 5 minutes.
>>
>>51470550
Someone new to programming shouldn't be on /g/, but in a learning site. Pick up a book or a good website to learn a language that suits your level (which is pretty much as low as it can be from the look of things).

Pick up the language's documentation from the official websites, follow the tutorials, memorize the principles of programming, and most important part -- Exercise, exercise, exercise!! The more you do it, the easier it gets. Challenge yourself, investigate, improve. If you get frustrated, that's okay. Every programmer gets frustrated. Just try again until shit starts to make sense.

And for the love of god, don't look for a solution to your problem online without atleast spending half the day trying to solve it alone.

Python is easy shit, you'll manage if you're not retarded.
Thread posts: 19
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.