CodeSolved

A comprehensive source of programming questions and exercises

Calculate speed

Practice Easy 840/ Download 507 Views

Write a program that takes the distance and the time to print speed in the output

Speed ​​= to move / time

12 Answers

This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
x = int(input('lotfan masafat ra be metr vared konid')) # Distance traveled to meter
y = int(input('lotfan zaman ra be sanie vared konid')) # Distance traveled to seconds
s = (x/y) # Formula Calculate speed
print (s)
def ss():
    while True:
        jabejaee = int(input("entre your number jabejaee:"))
        if  jabejaee <= 0:
            break
        s = int(input("entre your number s:"))
        if s <= 0:
            break
        sorat = jabejaee / s  # The speed is equal to the displacement divided by time
        print(f"sorat: {sorat}")
ss()

I got the same number for this. Arman.danyy


a=float(input("enter the masafat:"))
b=float(input("enter the sorat:"))
result=a/b
print(result)
Roghaye.m Download Python
def calculate_speed(distance, time):
    if time == 0:
        return "time not ziro"
    speed=distance / time
    return f'speed:{speed} km/h'
distance= float(input("distance(km): "))
time=float(input("time(h): "))
print(calculate_speed(distance,time))
distance  = float(input("Please enter distance (km): "))
time = float(input("Please enter time (hour): "))
if time != 0:
    speed = distance / time
print(f"speed = {speed:.1f} km/h")
Behcoder Download Python
i = float(input("taym (saat):  "))
y = float(input('masafat tey shode (kelometr):  '))
print(y/i,': kelomet bar saat sorat')
def harekat():
    masafat = int(input("please enter masafate tey shodeh(m): "))
    zaman = int(input("please enter moddate zaman(s): "))
    print("sor at = ", masafat / zaman , "m/s")
harekat()
<< Previous page 1 2 Next page >>

Submit answer

Submitting answers is currently unavailable.

Related content

Detection using AI
×
×
Close