Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I\'m having an issue with string substitution. *** randomquote and randompic are

ID: 3932513 • Letter: I

Question

I'm having an issue with string substitution.

*** randomquote and randompic are both indexes of lists set to variables.

***there IS tab before the print(""" it just won't show up when I post the question.

Here is what I have:

print("""

<html>
<head>
<title>Quote and Image of the Day of Mario Batali</title>
</head>


<body>
Quote: %s
Pic: <img src '%s' width = 100 height = 7>

</body>
</html>

""" %s = (randomquote, randompic))

I keep getting an error with the %s = (randomquote, randompic)) saying that it "Keyword can't be an expression"

Can someone suggest an alternative to help get past this? Thanks

Explanation / Answer

"""

Remove %s at the end of the print statement.

I have taken some sample input's for randomquote and randompic, you can remove that.

"""

randomquote = "Hello World!"
randompic = "PIC"
print("""
<html>
<head>
<title>Quote and Image of the Day of Mario Batali</title>
</head>

<body>
Quote: %s
Pic: <img src '%s' width = 100 height = 7>
</body>
</html>
""" %(randomquote, randompic))

"""

sample output

"""

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote