Write Python statements that print the next formatted output

Write Python statements that print the next formatted outputs using the already assigned variables first, middle, and last: first = last = middle = sigel, marlena mae sigel, marlena M, marlena M, sigel M. M. sigel

Solution

Yes, your code is absolutely right.

Why don\'t you try it by running it on a python interpreter.

If it is not possible for you to install the interpreter locally, you can always use online interpreters.

This is a good one: https://repl.it/languages/python3

Anyways, here is the .py file:

first = \"Marlena\"
middle = \"Mae\"
last = \"Sigel\"

print(\"%s, %s %s\"%(last, first, middle))
print(\"%s, %s %s.\"%(last, first, middle[0]))
print(\"%s %s. %s\"%(first, middle[0], last))
print(\"%s. %s. %s\"%(first[0], middle[0], last))

 Write Python statements that print the next formatted outputs using the already assigned variables first, middle, and last: first = last = middle = sigel, marl

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site