I have a number.
num = 5
I want to create a pattern of question marks i.e '(?,?,?,....n times)' where n is the number.
in this case the output should be string containing 5 Question marks seperated by comma.
(?,?,?,?,?) #dtype str
I tried it using the below method:
q = '?'
q2 = '('+q
num = 5
for i in range(num-1):
q2 += ','+q
q3 = q2+')'
print(q3)
>>> (?,?,?,?,?)
But it seems very lengthy and naive, is there any pythonic way of doing it? preferably a one liner?
q3 = num * ('?',)