How i can end the statement? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

How i can end the statement?

like in c, we end the statement by using semi-colon.So how i can end the statement in python ?

7th May 2018, 5:19 AM
varun pawar
2 Antworten
+ 3
The correct syntax for your print statement is: print('hello') or print("hello") NOTE: no ';' to be added at the end like you do in other languages. ********************************* SOURCE: https://www.tutorialspoint.com/JUMP_LINK__&&__python__&&__JUMP_LINK/python_basic_syntax.htm Type the following text at the Python prompt and press the Enter key >>> print "Hello, Python!" If you are running new version of Python, then you would need to use print statement with parenthesis as in print ("Hello, Python!");. However in Python version 2.4.3, this produces the following result − Hello, Python!
7th May 2018, 5:21 AM
Rahul George
Rahul George - avatar
+ 2
In Python you don't need an end statement so print("Hello") could be one line
7th May 2018, 5:34 AM
Gleb Koval
Gleb Koval - avatar