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

+16 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 (2k points)
edited by
+4

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)

3 Answers

+1 vote

Thank you, very useful.

answered by (4.4k points)
0 votes

Thank you for the script!

answered by (4.1k points)
0 votes

Thank you! This makes calculating super convenient!

answered by (1.2k points)
...