Answers for "python multi line string"

11

python datetime string

import datetime

today = datetime.datetime.now()
date_time = today.strftime("%m/%d/%Y, %H:%M:%S")
print("date and time:",date_time)
Posted by: Guest on May-21-2020
11

python datetime string

import datetime

today = datetime.datetime.now()
date_time = today.strftime("%m/%d/%Y, %H:%M:%S")
print("date and time:",date_time)
Posted by: Guest on May-21-2020
5

multiline input in python

print("Enter the array:\n")   
userInput = input().splitlines()
print(userInput)
Posted by: Guest on August-13-2020
5

multiline input in python

print("Enter the array:\n")   
userInput = input().splitlines()
print(userInput)
Posted by: Guest on August-13-2020
0

python variables in multiline string

toname = "Peter"
toemail = "p@tr"
subject = "Hi"
content = f"""From: Fromname <fromemail>
    To: {toname} <{toemail}>
    MIME-Version: 1.0
    Content-type: text/html
    Subject: {subject}

    This is an e-mail message to be sent in HTML format

    <b>This is HTML message.</b>
    <h1>This is headline.</h1>
"""
Posted by: Guest on March-17-2021
0

python variables in multiline string

toname = "Peter"
toemail = "p@tr"
subject = "Hi"
content = f"""From: Fromname <fromemail>
    To: {toname} <{toemail}>
    MIME-Version: 1.0
    Content-type: text/html
    Subject: {subject}

    This is an e-mail message to be sent in HTML format

    <b>This is HTML message.</b>
    <h1>This is headline.</h1>
"""
Posted by: Guest on March-17-2021

Python Answers by Framework

Browse Popular Code Answers by Language