-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path02_print_function.py
More file actions
61 lines (54 loc) · 2.58 KB
/
Copy path02_print_function.py
File metadata and controls
61 lines (54 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#======================================================================================
# PRINT() FUNCTION
#--------------------------------------------------------------------------------------
# The print() function in python is used to display output on the screen (console)
# It helps to see values,messages, or results of calculations while a program is running
#======================================================================================
print("-----------------")
print(" Learn Python ")
print("-----------------")
print("Hi Python")
#--------------------------------
# Character | Meaning |
#--------------------------------
# \n | New Line |
# \t | Tab |
# \\ | Backslash |
# \' | Single Quote |
# \" | Double Quote |
#--------------------------------
print("Hi \"Python\"") # printing double quote using \" character
print('Hi "Python"') # printing double quote using singe quote
print('Hi \'Python\'') # printing singe quote using \' character
print("Hi 'Python'") # printing singe quote using double quote
print("path: c:\\Users\\Kevin\\Documents") # print backslashes using \\ character
# printing two msgs using two print() functions
print()
print("Message1")
print("Message2")
print()
# printing the two msgs using \n new line character
print("Message1\nMessage2\n")
print("Message1 Message2") # Manual tab
print("Message1\tMessage2\n") # \t Tab character
#--------------------------------------------------------------------------------------
# Exercise: print the given below output using print() function and other characters
#--------------------------------------------------------------------------------------
# Your Learning Path:
# -Python Basics
# -Data Engineering
# -AI
print("Your Learning Path\n\t-Python Basics\n\t-Data Engineering\n\t-AI\n")
#--------------------------------------------------------------------------------------
# """ Triple Quotes allows us to write text in multiple line strings
#--------------------------------------------------------------------------------------
print("""Your Learning Path
-Python Basics
-Data Engineering
-AI""")
#--------------------------------------------------------------------------------------
# summary of Print()
#--------------------------------------------------------------------------------------
# It is a Built-in Python Function
# Display message in output for users
# Use Cases: Communicate, Show Results, Debug, Test