Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+9 votes

heres a short python script to calculate for the Q&A participation grade:

import math

def grade_val(x):
    return 10 * (math.log2(x) - 2)

points = int(input("Enter current points: "))
result = grade_val(points)

print("your result:", result)

the return statement comes out weird on this website but it should be indented below the grade_val(x)
asked in CSC 305 Fall 2024 by (896 points)
edited by
+3

Ian -- you can se the { } button on the toolbar when you post (or edit) a question or answer, to make your answer be formatted as code instead of regular text -- that will fix the indenting problems.

import math

def grade_val(x):
    return 10 * (math.log2(x) - 2)

points = int(input("Enter current points: "))
result = grade_val(points)

print("your result:", result)

Please log in or register to answer this question.

...