- Examples
- print("string") - Example 1
- print('string') - Example 2
- print("string1", var1) - Example 3
- print("string1", var1, "string2", var2, ...) - Example 4
- print("string1","\nString2") - Example 5
- print("string",end=' ') - Example 6
print("Hello World")
Result :--------------------------
Hello World
print('Hello World')
Result :--------------------------
Hello World
score = 75
print("Your score is ",score)
Result :--------------------------
Your score is 75
score = 75
grade = "C"
print("Your score is ",score, " And ", "Your Grade is ",grade)
Result :--------------------------
Your score is 75 And Your Grade is C
score = 75
grade = "C"
print("Your score is ",score, "\nYour Grade is ",grade)
Result :--------------------------
Your score is 75
Your Grade is C
print("===Print without New Line at the end ===")
for i in range(5) :
print(i, " ")
print("===Print without New Line at the end ===")
for i in range(5) :
print(i, " ", end=' ')
Result :--------------------------
===Print without New Line at the end ===
0
1
2
3
4
===Print without New Line at the end ===
0 1 2 3 4
< Example 7 >