Need Help New at coding

I created a code but my return to my label always come back looking like this:

PB
[0, 2, 5, 8, 9]

My question how can I delete the and get the numbers only

Hi,

can you be more specific about the context and programming language?

Cheers,
Michael

1 Like

The context will be shown in the picture and I’m using pythonista 3 iOS

Hi,

that’s a Python IDE for iOS, so you’re programming Python. Can you share the code snippets you already have for printing this? Please provide as much details as needed. Right now I don’t know how it relates to GitLab.

Cheers,
Michael

This is probably not a GitLab I don’t know just looking for help thanks here is the script

“ import random
import ui

def Function():
v = ui.View()
v.background_color = ‘white’
v.background_frame = ‘0, 0, w, h’

for i in range(1,5):
    b = ui.Button()
    b.frame=(-15+i*70,400,60,70)
    b.border_width= 1.5
    b.border_color = 'black'
    b.title = str(i)
    b.background_color='lightgray'
    b.action = b_action
    v.add_subview(b)
    b.tint_color = 'red'
    
l = ui.Label(
alignment=ui.ALIGN_CENTER,
bg_color='white',
border_color='black',
border_width=1.5,
frame=(50, 100, 100, 50),
name='l', font=('Copperplate', 18))


l.text_color='red'
l.number_of_lines = (2)
l.frame = (12,100,350,80)
v.add_subview(l)
v.present('screen')

def b_action(sender):
x = sender.title
l = sender.superview[‘l’]
if x == ‘1’: l.text = 'Megabucks '+str(Lottery.lotteryLogic (1, 46, 6))
elif x == ‘2’: l.text = 'Lucky 4 Life '+str(Lottery.lotteryLogic (1, 48, 5))+str(Lottery.lotteryLogic (1, 18, 1))
elif x == ‘3’: l.text = 'Powerball '+str(Lottery.lotteryLogic (1, 69, 5))+str(Lottery.lotteryLogic (1, 26, 1))
elif x == ‘4’: l.text = 'Mega Mil '+str(Lottery.lotteryLogic (1, 70, 5))+str(Lottery.lotteryLogic(1, 25, 1))

class Lottery:
def init( self ):
self.a = 0

def lotteryLogic(startPosi, endPosi, interateNumber):
    a = random.sample (range(startPosi, endPosi), interateNumber)
    a.sort()
    return a

if name == ‘main’:
Function()