Hirdetés
- Projektor topic
- Milyen egeret válasszak?
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- ASUS notebook topic
- AMD Ryzen 9 / 7 / 5 / 3 5***(X) "Zen 3" (AM4)
- TCL LCD és LED TV-k
- Intel Core i5 / i7 / i9 "Alder Lake-Raptor Lake/Refresh" (LGA1700)
- Gaming notebook topik
- Mini-ITX
- Milyen billentyűzetet vegyek?
Új hozzászólás Aktív témák
-
válasz
V.Stryker
#206
üzenetére
- Bekéred a változókat (váltási arány, vátás iránya, hány számot jelenítsen meg (n) a sorozatból, melyik legyen az első eleme (m), mi legyen a növekmény (q))
- legenerálod a forrás tömböt
- megcsinálod a váltást
- kiiratodAddig jáccottam, míg meg nem csináltam szép csicsásra

m = int(input("Start number of the range:"))
n = int(input("Count of range numbers:"))
q = float(input("Base of the range:"))
conv_rate = float(input("Conversion Rate:"))
conv_dir = int(input("Conversion (0* - EUR to CAD, 1 - CAD to EUR):"))
nm = range(m, m+n)
source = [pow(q,i) for i in nm]
dest = [i*conv_rate for i in source]
conv_s = '+ {0:^10} {2} {1:^10} +'
val_pack = {}
if conv_dir != 1:
conv_s = conv_s.format('EUR', 'CAD', '==>')
val_pack = zip(source, dest)
else:
conv_s = conv_s.format('EUR', 'CAD', '<==')
val_pack = zip(dest, source)
print ('+{0:-<13}+{0:-<13}+'.format('-'))
print (conv_s)
print ('+{0:-<13}+{0:-<13}+'.format('-'))
for (eur, cad) in val_pack:
print ('| {0:>10.2f} | {1:>10.2f} |'.format(eur, cad))
pass
print ('+{0:-<13}+{0:-<13}+'.format('-'))
Új hozzászólás Aktív témák
- Akko, Gateron, Haimu x Geon kapcsolók
- Szép! Lenovo ThinkPad X1 Yoga G6 x360 Érintős Hajtogatós Laptop Tab 14" -50% i5-1135G7 16/256 +Toll
- Samsung Galaxy Tab S10 Ultra 256 GB újszerű állapot
- GamerPC RX 9070/7700X/32GB DDR5/1TB M2
- Szép! Lenovo ThinkPad X1 Yoga G6 x360 Érintős Hajtogatós Laptop Tab 14" -50% i5-1135G7 16/256 +Toll
- LG 34WQ75X-B - 34" Ívelt IPS Panel - 3440x1440 2K QHD - 60Hz 5ms - FreeSync - USB Type-C 90W
- Thermalright Aqua Elite 360 V3
- Bomba ár! Dynabook Portege X30-F - i7-8565U I 16GB I 256SSD I 13,3" FHD I Cam I W11 I Garancia!
- Telefon felvásárlás!! Apple Watch Series 6/Apple Watch Series 7/Apple Watch Series 8
- Honor 90 Lite / 8/256GB / Kártyafüggetlen / 12Hó Garancia
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: Central PC számítógép és laptop szerviz - Pécs
Város: Pécs



