'Need help making statistics calulator [closed]
Currently working on statistics calculator but an error message saying invalid syntax which points at print in the mode section
import statistics
amountOfNumbers = input("How many numbers are you using? ")
usersNumbers = input("What are your numbers? ")
print("Mean: " , statistics.mean(usersNumbers)
print("Mode: " , statistics.mode(usersNumbers))
print("Median: " , statistics.median(usersNumbers))
Error message reads:
File "D:\Luke's Coding stuff\Python\bot1.py", line 5
print("Mode: " , statistics.mode(usersNumbers))
^
SyntaxError: invalid syntax
Solution 1:[1]
The problem is actually in the line above it, you missed a bracket.
print("Mean: " , statistics.mean(usersNumbers))
The reason it told you there was a syntax error in line 5 is because it expected the code to follow the print function's "value" syntax.
Solution 2:[2]
You are missing a closing parentheses after your first print statement.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Pyr0 |
| Solution 2 | Gufflim |
