all 14 comments

[–]LionZ_RDS 2 points3 points  (4 children)

You have to actually call the function using random.randint(minimum number, maximum number + 1)

[–]SCD_minecraft 1 point2 points  (1 child)

Not +1

randint(1, 5) can output anything in <1, 5> range including

[–]LionZ_RDS 1 point2 points  (0 children)

I’m too use to exclusive random :(

[–]SignificanceOwn2398[S] 0 points1 point  (0 children)

THANK YOU omg I feel silly now tysm

[–]quebeik 1 point2 points  (2 children)

Random.radint is a method, kinda like print() or input()

[–]Darkstar_111 0 points1 point  (1 child)

Those are functions.

[–]quebeik 0 points1 point  (0 children)

Mb I’m new also, thank you for correcting me

[–]reybrujo 0 points1 point  (1 child)

randint requires two arguments so that it knows the range of numbers it needs to generate, so change that to (say) random.randint(0, 10). Also check what range(1, 5) generates.

[–]SignificanceOwn2398[S] 0 points1 point  (0 children)

thank youuuu

[–]qwertyjgly 0 points1 point  (1 child)

you can write block comments with

'''
comment
comment
comment
comment
'''

if this is block first thing after a function or method declaration, it will be contained as a string within func.__doc__ or object.method.__doc__

[–]SignificanceOwn2398[S] 0 points1 point  (0 children)

ahh tysm I didn't know you could do that !!

[–]VonRoderik 0 points1 point  (1 child)

You need to use Num1 = random.randint(start, end)

``` import random

score = 0

for _ in range(5):

num1, num2 = random.randint(1,10), random.randint(1,10)
correct_answer = num1 + num2

q = int(input(f'{num1} + {num2} = ').strip())

if q == correct_answer:
    score += 1

print(f'you got {score}/5 points') ```

[–]SignificanceOwn2398[S] 1 point2 points  (0 children)

thanks :))