A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

anonymous

  • 5 years ago

how can I pass to the next line in python?

  • This Question is Closed
  1. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I write print("please, type sth") but I want to continue to a new line with answer=raw_input() when I press enter It just evaluates the expression, But I want to skip to a new line

  2. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    i'm not sure what your asking exactly, but perhaps you need to append \n to your sentence answer=raw_input("please, type sth\n") keeping the \n inside the quotes

  3. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    but I mean: http://en.wikibooks.org/wiki/Python_Programming/Variables_and_Strings the codes are made of 2-3 lines, How can I write like them

  4. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    It sounds like you're running in the interpreter instead of creating a script file. You can use a text editor to create a .py file, then run it in Python. On another note, Nessman's suggestion will help clean up your code. There's no need to print a raw_input prompt on a separate line, just use something like: first_name = raw_input('Please enter your first name: ')

  5. anonymous
    • 5 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Adding on to GabeF's answer to get to a new text file from the interpreter go file New Window or ctrl+N. That is where you type your code and edit your code then to run it either hit F5 or go run at the top and click Run Module.

  6. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

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.