Jun-13-2018, 02:20 PM
Please read the forum rules and insert your code in CODE TAGS. CODE TAGS preserve indentation, which is very important in Python. https://python-forum.io/misc.php?action=help&hid=25
Here are three possible methods. For loops are considered more pythonic than while loops.
Here are three possible methods. For loops are considered more pythonic than while loops.
myvalue = 0 while myvalue <= 50: print("{:.1}".format(myvalue/10 )) myvalue += 1 # Possible extra value printed due to rounding error myvalue = 0.0 while myvalue <= 5.0: print("{:.1}".format(myvalue)) myvalue += 0.1 for myvalue in range(0, 51): print("{:.1}".format(myvalue/10 ))Lewis
To paraphrase: 'Throw out your dead' code. https://www.youtube.com/watch?v=grbSQ6O6kbs Forward to 1:00