Conversion
Write a program that receives some as a warm from the user and converts to kilograms
Example:
Write a program that receives some as a warm from the user and converts to kilograms
Example:
let msg = 'error' alert(msg)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
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
g=input("Geram:") g=float(g) print(f"Kilogeram:{g/1000}")
weight_grams=float(input("enter weight>>>"))
weight_kiloo=weight_grams/1000
print(weight_kiloo)
grams = float(input("مقدار گرم را وارد کنید: "))
kilograms = grams / 1000
print(kilograms)
def convert_grams_to_kilograms(gtk): if gtk > 0: print(f"grams => {gtk}g\nkilograms => {gtk / 1000}kg") else: print("Invalid input, please enter correct value!!") convert_grams_to_kilograms(float(input("Enter a number to convert: "))) convert_grams_to_kilograms(float(input("Enter a number to convert: ")))
x=int(input())
z=x/1000
print(z)
gram = int(input("entre your number:")) kilo = 1000 x = gram / kilo print(f"kiogram:{x}")
g=input(Enter your g) print(g/1000)
Submitting answers is currently unavailable.
You must be logged in to access this section.
Login/Sign up If you don’t understand the exercise or can’t solve it for any reason, that’s completely
normal—don’t worry 😊
Try checking out easier exercises and reviewing different answers
submitted by others. Gradually, you can move on to more challenging exercises. Also, your answer
might be correct even if it’s different from others.