feat(r-1.3_scratch.py): attempt 1 at formatting input string to float
This commit is contained in:
@@ -4,15 +4,16 @@
|
||||
Created on Wed Sep 2 22:49:38 2026
|
||||
|
||||
@author: joseph
|
||||
- I got very tired and decided to scrap the whole process I've been chasing.
|
||||
I will start again soon, scrapping the input loop idea and just focusing on
|
||||
function itself.
|
||||
- I figured out the function after some rest. Now I want to sort out an input
|
||||
method that allows for any number of floats.
|
||||
"""
|
||||
|
||||
def minmax(*data):
|
||||
ordered = sorted(data)
|
||||
data = (ordered[0], ordered[-1])
|
||||
print(data)
|
||||
|
||||
|
||||
minmax(24, 3, 84.26, -15)
|
||||
|
||||
|
||||
user_data = float(input('Enter any amount of numbers, separated by spaces: '))
|
||||
list_data = user_data.split()
|
||||
minmax(list_data)
|
||||
Reference in New Issue
Block a user