Question
2. Write a program that prints all numbers between 27 and 78, one number per line.
In questions 3, 4, and 5 the following list is used: [1,2,5,6,3,77,9,0,3,23,0.4,-12.4,-3.12]
3. Using "for" loop, write program that finds the smallest number in the list.
4. Using loops, calculate arithmetic mean of all numbers in the list. Do not use built-in function in Python.
5. Using loops, display differences of all consecutive pairs of numbers in the list.
Solution Preview
These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.
# exercise1.pynumbers = list()
for i in range(5):
number = float(input("Enter a number: "))
numbers.append(number)
largest = numbers.pop(0)
for i in range(4):
number = numbers.pop(0)
if number > largest:
largest = number
print("Largest number is: {0}".format(largest))...
By purchasing this solution you'll be able to access the following files:
Solution.zip.