Using Range Function

Posted by Michael Alexander Riechmann on Stack Overflow See other posts from Stack Overflow or by Michael Alexander Riechmann
Published on 2012-11-26T22:58:02Z Indexed on 2012/11/26 23:03 UTC
Read the original article Hit count: 251

Filed under:
|

My goal is to make a program that takes an input (Battery_Capacity) and ultimately spits out a list of the (New_Battery_Capacity) and the Number of (Cycle) it takes for it ultimately to reach maximum capacity of 80.

Cycle = range (160)
Charger_Rate = 0.5 * Cycle
Battery_Capacity = float(raw_input("Enter Current Capacity:"))
New_Battery_Capacity = Battery_Capacity + Charger_Rate

if Battery_Capacity < 0:
    print 'Battery Reading Malfunction (Negative Reading)'

elif Battery_Capacity > 80:
    print 'Battery Reading Malfunction (Overcharged)'

elif float(Battery_Capacity) % 0.5 !=0:
    print 'Battery Malfunction (Charges Only 0.5 Interval)'

while Battery_Capacity >= 0 and Battery_Capacity < 80:
    print New_Battery_Capacity 

I was wondering why my Cycle = range(160) isn't working in my program?

© Stack Overflow or respective owner

Related posts about python

Related posts about range