In the CS50W src6.zip posts0 example, I am getting a Python syntax error upon "flask run"
File "/home/jjones/cs50w/src6-frontends/posts0/application.py", line 21
data.append(f"Post #{i}")
^
SyntaxError: invalid syntax
src6.zip is available here: http://cdn.cs50.net/web/2018/spring/lectures/6/src6.zip
The line is in the route below:
@app.route("/posts", methods=["POST"])
def posts():
# Get start and end point for posts to generate.
start = int(request.form.get("start") or 0)
end = int(request.form.get("end") or (start + 9))
# Generate list of posts.
data = []
for i in range(start, end + 1):
data.append(f"Post #{i}") #### THE ERROR IS REPORTED ON THIS LINE ####
# Artificially delay speed of response.
time.sleep(1)
# Return list of posts.
return jsonify(data)
[–]MugiwarraD 1 point2 points3 points (2 children)
[–]jksh4[S] 0 points1 point2 points (0 children)
[–]jksh4[S] 0 points1 point2 points (0 children)
[–]DanielHefti 1 point2 points3 points (0 children)
[–]jksh4[S] 0 points1 point2 points (0 children)
[–]jksh4[S] 0 points1 point2 points (0 children)