About 145,000 results
Open links in new tab
  1. Hello World in Python - Stack Overflow

    Jul 3, 2009 · @MiffTheFox: Python 2.x uses print as a statement. The relatively new Python 3 made print a function instead. The majority of Python programmers are still using 2.x because of its extensive library and framework support, so 3.0 …

  2. Syntax error on print with Python 3 - Stack Overflow

    May 5, 2014 · Because in Python 3, print statement has been replaced with a print() function, with keyword arguments to replace most of the special syntax of the old print statement. So you have to write it as So you have to write it as

  3. Left out 'print' function in Python, e.g. (print "hello world") vs ...

    >>> print "hello world" hello world The programs using print function, as we know is used to print the given string or numeric data. Program type 2 >>> "hello world" 'hello world' >>> 'hello world' 'hello world' When the print function is not used, and the string is directly told to be printed by giving it within single/double quotes, the ...

  4. Python 3.3 Hello program - Stack Overflow

    python 3.x (3.5) #Just the hello world print('Hello world!') #use input() to let the user assign a value to a variable named myName myName = input('What is your name ...

  5. python - Run certain code every n seconds - Stack Overflow

    Aug 3, 2010 · Is there a way to, for example, print Hello World! every n seconds? For example, the program would go through whatever code I had, then once it had been 5 seconds (with time.sleep()) it would execute that code. I would be using this to update a file though, not print Hello World. For example:

  6. print syntax error with python 3 - Stack Overflow

    After installing python 3.1, I cannot print anything. Here is an example: >>> print "Hello World" File "<stdin>", line 1 print "Hello World" ^ SyntaxError:

  7. Python print statement “Syntax Error: invalid syntax”

    Sep 28, 2011 · In Python 3, print is a function, you need to call it ... In Python 3 print "Hello world" gives invalid ...

  8. python - If Condition To Print “HelloWord” - Stack Overflow

    Feb 20, 2019 · What should be the “condition” so that the following code snippet prints both HelloWorld! if "condition": print "Hello" else: print "World" This can be achieved in C by following code snippe...

  9. How can I print bold text in Python? - Stack Overflow

    Nov 2, 2022 · In Python 3 you can alternatively use cprint as a drop-in replacement for the built-in print, with the optional second parameter for colors or the attrs parameter for bold (and other attributes such as underline) in addition to the normal named print arguments such as file or end.

  10. Display Python Output in Sublime text - Stack Overflow

    Dec 30, 2013 · New to Python & Sublime. Problem: I type 'print ("Hello world") How do I get it to show me the output (Hello world), is it in a separate window? or... I understand I can use the Python Console built in, but that's a command line, what about when I get to use a ton of code, how do I get the output?

Refresh