Safe Average Calculator
Write a function safe_average(values) that takes a list of strings, converts each one to a number, and returns the average of only the ones that convert successfully - skipping any that don't, without crashing. If none of the values convert successfully, return the string "No valid numbers.".
Read n (how many values), then n lines of raw text, and print the result.
Example: 3, then 10, 20, 30 → all valid → average is 20.0.
main.py
Loading editor…
Console
Run your code to see output here.