Various ways to use the print() function in Python

Published: 09 October 2022
on channel: KidzCode AI
100
4

This video is for beginners level Python programmers who just started to code in Python.
This video will show you different strategies to print in Python.
We all know about the print() function in Python. Using the print() function, we can print a message. For example, we can print using single quotation marks or double quotation marks-
print(“Python”) or
print(‘Python’)
However, there are several other things to consider when you are printing in Python.
Let's look at them one by one
1. Using double quotation when you have apostrophes to print
print(“X’s mission”)
2. Using single quotations when you have double quotations to print
print (‘“Run”, he said’)
3. Using concatenations (+)
4. Using print("your text", variable)
5. Using print(“your text”, end ="")
6. Using print(“your text”, end ="") (and variable converting to string or without converting to a string)
7. Using print("your text\n")
8. Using print()
9. Using print("text", variable+ variable)

Code Example:
print("Python")
print('Python')

print("X's mission")

print('"Run", he said')
a = 20
print("I am printing", a, end=". ")
print("I am printing this again")

price = 20
#price = str(price)

print("The price is $",end="")
print(price,"\n")
print()
print("1.Python\n2.Java\n3.C++\n4.JavaScript")

print("The price is",price+10)


On this page of the site you can watch the video online Various ways to use the print() function in Python with a duration of hours minute second in good quality, which was uploaded by the user KidzCode AI 09 October 2022, share the link with friends and acquaintances, this video has already been watched 100 times on youtube and it was liked by 4 viewers. Enjoy your viewing!