Write the command in multiple lines in Python

Assign a large value to a variable in Python

Example to show the assigned large value to a variable which comes in different lines in Python program.

Use “”” quote for assign value as it is in the same format:

v_query = """CREATE TABLE testtable ( 
             Id int(11) NOT NULL,
             Name varchar(250) NOT NULL,
             PRIMARY KEY (Id)) """

print(v_query)

Output:

CREATE TABLE testtable ( 
             Id int(11) NOT NULL,
             Name varchar(250) NOT NULL,
             PRIMARY KEY (Id)) 
This entry was posted in Python on by .
Unknown's avatar

About SandeepSingh

Hi, I am working in IT industry with having more than 15 year of experience, worked as an Oracle DBA with a Company and handling different databases like Oracle, SQL Server , DB2 etc Worked as a Development and Database Administrator.

Leave a Reply