I'm new at Python coding and in DaniWeb. Really nice forum :icon_cheesygrin: Need some help w/ the following code:
the content of saldo.txt is the following
1000
The code I was talkin' about:
# [...]
f = open('C:/saldo.txt')
print f
saldo = f.readline()
f.close()
if saldo <= 100:
a = 5
b = 70
if 1000 >= saldo > 100:
a = 50
b = 700
if 1000 < saldo < 2500:
a = 100
b = 1000
if 2500 <= saldo < 5000:
a = 250
b = 2000
if 5000 <= saldo < 10000:
a = 500
b = 5000
if 10000 <= saldo < 25000:
a = 1000
b = 7500
if 25000 <= saldo < 50000:
a = 2500
b = 10000
if 50000 <= saldo < 100000:
a = 5000
b = 10000
if saldo >= 100000:
a = 1
b = 1000000000
print (a, b)
# [...]
My problem is:
"a" is being printed as 1 instead of 50
"b" is being printed as 1000000000 instead of 700
:confused: