ball-game created in Python 3
Follow standard identifier conventions.  Variable are lower_case, class names should be CamelCase, and constants should be UPPER_CASE.  With this in mind, your block of colours at the start should be altered:

# Colours
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
RED = (255, 0, 0)
#... etc ...




Named colours are fine, but what are you using them for?  Maybe, after naming colours, name some of the usages, and assign the named colours. 

BALL_COLOUR = RED
SCORE_COLOUR = WHITE




Note the spacing above.  

ux+=ax*t
uy+=ay*t
x+=ux*t
y+=uy*t


... I find hard to read.  Add a space before and after operators, a space after commas, etc. 

ux += ax * t
uy += ay * t
x += ux * t
y += uy * t


... is much easier to read. 



score, lives=0,3


Tuple unpacking assignment is a wonderful feature.  But don’t use it for unrelated values, like score and lives.  Use two separate assignment statements. But when you do use it, remember spaces around the equals, and after the commas.



Declare variables as close as possible to where you use them.  What is this running = True statement, near the start?  Is there someone walking and running as well as bouncing a ball?

running = True
while running:
     # ...


This is much clearer.  The value controls the loop.  



Watch for “if condition, do something, else if different condition, do same thing”.  Use an “or” in the test.  

if ev.key == pygame.K_UP or ev.key == pygame.K_DOWN:
    ay = 0




Don’t intermix unrelated code. 

textDisp = ...
pygame.draw.circle(...)
display.blit(textDisp, ...)


Keep the two textDisp lines together; the circle draw code is unrelated and should be moved before or after this code. 



Elephant in the room:  Variable names. They are terrible.  I’d suggest better ones, but I’d suggest using classes for player/projectile even more.  And maybe a function or two for organization. But as this is your third project, I don’t want to confuse you with constructs you may not have learned yet. 

Let us know what you know, and perhaps we can help further. 



Inefficiency: repeating the same test 20 times.  Both y and yp1 remain constant in this loop:

for g in range(20):
    if x&gt;xp1[g]-10 and x&lt;10+xp1[g] and y&gt;yp1-15 and y&lt;yp1+15:


Instead, check for a y-collision first, and only if it is a possibility, then check the 20 x-collisions.

if y &gt; yp1 - 15  and  y &lt; yp1 + 15:
    # loop over all xp1 values




Hard-coded numbers. You repeat 20 multiple times throughout the code.  What if you want to change that?  Find every place it is used and change it?  Better: use a variable for num_projectiles.  Even better, just iterate over the storage structure itself:

if y &gt; yp1 - 15  and  y &lt; yp1 + 15:
    for xp in xp1:
        if x &gt; xp - 10  and  x &lt; xp + 10:
            # collision code