S
S
Samad_Samadovic2021-06-06 01:40:31
Python
Samad_Samadovic, 2021-06-06 01:40:31

Hello, how to convert a string to a tuple for writing in sql (more precisely, updating a column through the Update method)?

Line example:
Hello world:)_!
Expected result:
(Hello world:)_!)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Studentka1996, 2021-06-06
@Samad_Samadovic

I would do like this:

my_str = 'Hello world:)_!'
    print(tuple(my_str.split(',')))
    print(''.join(my_str))

In general, this question is easily googled and there are many solutions.
For example: https://ru.stackoverflow.com/questions/680345/%d0%...

L
lil.fxrrx, 2021-06-06
@mxrdxfxrrx

n = "Hello World!:)_!"
t = tuple(str(item) for item in n.split(','))
print(t) #for test

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question