i am getting whitespace error on output : I-290 is auxiliary, serving I- 90 going east/west. it should read : I-290 is auxiliary, serving I-90, going east/west. I can't figure out where the space is coming from after I- 90.
Zybook Lab
highway_number = int(input())
if(highway_number>=1 and highway_number<=99):
if(highway_number%2==0):
print("I-"+str(highway_number),"is primary, going east/west.")
else:
print("I-"+str(highway_number),"is primary, going north/south.")
elif(highway_number>=100 and highway_number<=999):
highway_number_string = str(highway_number)
length = len(highway_number_string)
rightmost_digits = int(highway_number_string[length-2:length])
if(rightmost_digits==0):
print(highway_number,"is not a valid interstate highway number.")
elif(rightmost_digits%2==0):
print("I-"+str(highway_number),"is auxiliary, serving I-",rightmost_digits,"going east/west.")
else:
print("I-"+str(highway_number),"is auxiliary, serving I-",rightmost_digits,"going north/south.")
else:
print(highway_number,"is not a valid interstate highway number.")
i am getting whitespace error on output :
it should read :
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images