Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

walne

In hwk 1.3 It gives the instructions: "Write a program that prints out the tic-tac-toe board from exercise 1.2, but uses variables to cut down on the amount of typing you have to do. What I wrote below outputs the correct answer; but it seems so inefficient to have to write print 5 times. Is it possible to print the output of multiple variables and have them jump down to the next line each time? a = " | |" b = "--------" print a print b print a print b print a

  • one year ago
  • one year ago

  • This Question is Closed
  1. estudier
    Best Response
    You've already chosen the best response.
    Medals 1

    I guess usually you would use some loop around print a and print b. You can put print a + "\n" + b for a new line.

    • one year ago
  2. walne
    Best Response
    You've already chosen the best response.
    Medals 0

    Great advice @estudier I used the "\n" to create this which printed the tic-tac-toe design perfectly: print a + "\n" + b + "\n" + a + "\n" + b + "\n" + a

    • one year ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.