roberthsu2003 / __2024_10_15__gjun_ai__

巨匠2024 10 15 AI初階 晚上2_4班
27 stars 2 forks source link

請建立一個公斤轉換為磅和磅轉換為公斤的程式 #2

Open roberthsu2003 opened 4 weeks ago

roberthsu2003 commented 4 weeks ago

公斤和磅的轉換

公斤轉換為磅
請輸入公斤:xxxx
xxx公斤=xxx磅
磅轉換為公斤
請輸入磅:xxxx
xxx磅=xxx公斤
roberthsu2003 commented 4 weeks ago
import math
side = float(input("請輸入對邊:"))
another_side = float(input("請輸入斜邊:"))
radian = math.asin(side / another_side)
degree = math.degrees(radian)
print(f'角度是:{round(degree,ndigits=2)}')
截圖 2024-10-24 晚上9 41 05
kuroneko1202 commented 4 weeks ago
print("公斤轉換為磅")
kilograms = float(input("請輸入公斤:"))
pounds = kilograms * 2.20426
print(f"{kilograms}公斤={pounds:.3f}磅")

print("磅轉換為公斤")
pounds = float(input("請輸入磅:"))
kilograms = pounds / 2.20426
print(f"{pounds}磅 = {kilograms:.3f}公斤")

擷取

rosaliehuang22 commented 4 weeks ago
# 公斤轉換為磅
kilograms = float(input("請輸入公斤:"))
pounds = 2.20426 * kilograms
print(f'{kilograms} 公斤 = {pounds:.2f} 磅')

# 磅轉換為公斤
pounds = float(input("請輸入磅:"))
kilograms = pounds / 2.20426
print(f'{pounds} 磅 = {kilograms:.2f} 公斤')

image

TingYi0921 commented 4 weeks ago
kilograms = float(input('請輸入公斤:'))
pounds = kilograms * 2.20426
print(f'{kilograms}公斤 = {round(pounds,ndigits=2)}磅')
pounds = float(input('請輸入磅:'))
kilograms = pounds / 2.20426
print(f'{pounds}磅 = {round(kilograms,ndigits=2)}公斤')

公斤轉換

xingxing8787 commented 4 weeks ago
kilo=float(input("輸入公斤:"))
pounds=kilo*2.20426
print(f"公斤:{kilo}=磅:{pounds:.2f}")

pounds=float(input("輸入幾磅:"))
kilo=pounds/2.20426
print(f"磅:{pounds}=公斤:{kilo:.2f}")

PY

user-frank commented 4 weeks ago
# 1公斤=2.20426磅
# kilograms,pounds

print("公斤轉換為磅")
kilograms = float(input("請輸入公斤"))
pounds = kilograms * 2.20426
print(f"{kilograms}公斤 = {pounds:.4f}磅")
print("")
print("磅轉換為公斤")
pounds = float(input("請輸入磅"))
kilograms = pounds / 2.20426
print(f"{pounds}磅 = {kilograms:.4f}公斤")

image

shinmaple commented 4 weeks ago
print('公斤轉換為磅')
kilograms = float(input("請輸入公斤:"))
pounds = kilograms * 2.20426
print(f'請輸入公斤:{kilograms}')
print(f'{kilograms}公斤 = {round(pounds , ndigits=2)}磅')

1

print('磅轉換為公斤')
pounds = float(input("請輸入磅:"))
kilograms = pounds / 2.20426
print(f'請輸入磅:{pounds}')
print(f'{pounds}磅 = {round(kilograms , ndigits=2)}公斤')

2

xxxung commented 4 weeks ago

公斤和磅的轉換

Vito8531 commented 4 weeks ago

公斤轉換回磅

""" 1公斤=2.20426磅 kilograms,pounds """ kilograms = float(input("請輸入多少公斤")) pounds = kilograms * 2.20426 print(f"{kilograms}公斤 = {pounds:.2f}磅")

python00

磅轉換回公斤

pounds = float(input("請輸入多少磅")) kilograms = pounds / 2.20426

print(f"{pounds}磅等於 {kilograms:.2f}公斤")

print(f"{pounds}磅等於 {round(kilograms,3)}公斤")

python01

cloudorz0525 commented 3 weeks ago

公斤轉磅

1公斤=2.20426磅 kilograms,pounds kilograms=float(input('請輸入公斤')) pounds=kilograms*2.20426 print(f'公斤:{kilograms},磅:{pounds:.4f}')

磅轉公斤

1公斤=2.20426磅 kilograms,pounds pounds=float(input('請輸入磅')) kilograms=pounds/2.20426 print(f'磅:{pounds},公斤:{kilograms:.4f}')

擷取

joshuayin1119 commented 3 weeks ago
kilo=float(input("幾公斤"))
po=kilo*2.20426
print(f"{kilo}公斤={po:.2f}磅")
po=float(input("幾磅"))
kilo=po/2.20426
print(f"{po}磅={kilo:.2f}公斤")

01 02

nekoya10 commented 3 weeks ago

公斤轉換為磅

print("公斤轉換為磅:")

kilograms = float(input("請輸入公斤"))

pounds = kilograms * 2.20426

print(f"公斤為:{kilograms}公斤 磅={pounds:.3f}磅")

磅轉換為公斤

print("磅轉換為公斤:")

pounds = float(input("請輸入磅"))

kilograms = pounds / 2.20426

print(f"磅為:{pounds}磅 公斤= {kilograms:.3f}公斤")

螢幕擷取畫面 2024-10-28 003627

yingming-Ma commented 3 weeks ago

a= float (input("請輸入一個公斤數")) pounds = a * 2.20426 print (f'{a}公斤={round (pounds,ndigits=2)}磅')

b= float (input("請輸入一個磅數")) kilograms = b / 2.20426 print (f'{b} 磅={round (kilograms,ndigits=2)}公斤')

image

maomaoyu330 commented 3 weeks ago
print("公斤轉換為磅")
kilograms = float(input("請輸入公斤:"))
pounds = kilograms * 2.20426
print(f'{kilograms}公斤 = {pounds:.2f}磅')

print("磅轉換為公斤")
pounds = float(input("請輸入磅:"))
kilograms = pounds / 2.20426
print(f'{pounds}磅 = {kilograms:.2f}公斤')

螢幕擷取畫面 2024-10-28 134420

Bellelin27 commented 3 weeks ago
#公斤轉換為磅
kilograms = float(input('請輸入公斤:'))
pounds = kilograms * 2.20426
print(f'{kilograms}公斤 = {round(pounds,ndigits=2)}磅')

螢幕擷取畫面_28-10-2024_221247_jubilant-sniffle-694wx54gj6x6hx6wv github1 dev

#磅轉換為公斤
pounds = float(input('請輸入磅:'))
kilograms = pounds / 2.20426
print(f'{pounds}磅 = {round(kilograms,ndigits=2)}公斤')

螢幕擷取畫面_28-10-2024_221247_jubilant-sniffle-694wx54gj6x6hx6wv github2 dev

POPOYANG97 commented 3 weeks ago

螢幕快照 2024-10-28 下午11 09 39

Horace2024 commented 3 weeks ago

image image

sunflower811 commented 3 weeks ago
print("This helps you transform kiolgrams and pounds")
K=float(input('Please input  Kilograms'))
K2=2.20426*K
print(f'{K}Kilograms={K2:.4f}pounds')
P=float(input('Please input  pounds'))
P2=P/2.20426
print(f'{P}pounds={P2:.4f}Kilograms')
image
benhuang1998 commented 3 weeks ago

公斤磅數轉換

wei1217-96 commented 3 weeks ago

螢幕擷取畫面 2024-10-29 182439

hua880529 commented 3 weeks ago

公斤轉換為磅

kilograms = float(input("請輸入公斤:")) pounds = 2.20426 * kilograms print(f'{kilograms} 公斤 = {pounds:.2f} 磅')

磅轉換為公斤

pounds = float(input("請輸入磅:")) kilograms = pounds / 2.20426 print(f'{pounds} 磅 = {kilograms:.2f} 公斤') 01 02

emelicat commented 3 weeks ago

KGTOP = 2.20426 n = int(input("請輸入1(公斤轉磅)或是2(磅轉公斤): "))

if n == 1: print("公斤轉換為磅") kilograms = float(input("請輸入公斤: ")) pounds = kilograms * KGTOP print(f"{kilograms}公斤 = {pounds:.3f}磅") elif n == 2: print("磅轉換為公斤") pounds = float(input("請輸入磅: ")) kilograms = pounds / KGTOP print(f"{pounds}磅 = {kilograms:.3f}公斤") else: print("錯誤,請輸入1或2") image