Write a program in Python to print "your name" in console using print() function!
# Program 2 # Program to Print your name using print() function # 1000+ Python Programs by Code2care.org print("Mike Alan")
This is quite similar to the first program we saw, instead of "Hello World" we just print our name.
⭐ print() is a build in function in Python3Syntax:
print(*objects, sep=' ', end='\n', file=None, flush=False)
Note: If you are using Python 2.x print is a statement and you will write the statement like below,
print "Mike Alan!"
If you run the above program in Python3 you will get an error,
print 'Mike Alan!' ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print('Mike Alan!')?
This is because Python3 (also known as Python 3.0, Python 3000, or Py3K) is not backward compatible with Python 2.x
Have Questions? Post them here!