Skip to content

Commit c73a0fd

Browse files
committed
Create print statement notes
1 parent b5bde24 commit c73a0fd

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed
File renamed without changes.

Notes/print_statement.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Python print() Function
2+
3+
# The print() function prints the specified message to the screen or other standard output device.
4+
# The message can be a string or any other object.
5+
# The object will be converted into a string before written to the screen.
6+
# The simplest way to produce output is using the print() function where you can pass zero or more expressions separated by commas.
7+
# This function converts the expressions you pass into a string before writing to the screen.
8+
9+
# Syntax:
10+
# print(object(s), sep=separator, end=end, file=file, flush=flush)
11+
12+
# Example:
13+
# Printing a message on the screen:
14+
print("Hello World")
15+
# Output: Hello World
16+
17+
18+
# Printing more than one object:
19+
print("Hello", "how are you?")
20+
# Output: Hello how are you?
21+

file_path

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hello world !

oops.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,14 @@ class my_class:
4444
# global variable
4545
strength='empty'
4646
classroom='None'
47+
a=20
4748

4849
def __init__(self,class_name="None",staff="Unallotted",fullname="None"):
4950
# self : Pointer to Current Object. staff=None is default arguments
5051
self.staff_name=staff # Instance variable creating automatically
5152
self.fullname=fullname
5253
self.classroom=class_name
54+
print(a)
5355
print(self.staff_name,self.fullname,self.classroom)
5456

5557

@@ -121,3 +123,13 @@ def myfunct(self,repname):
121123
# Keep in mind that the self parameter in the constructor refers to the instance being created and allows
122124
# you to access and set its attributes.
123125

126+
class my_class1:
127+
# global variable
128+
129+
def __init__(self):
130+
a=10
131+
b=20
132+
# self : Pointer to Current Object. staff=None is default argument
133+
print(a+b)
134+
s1=my_class1()
135+

0 commit comments

Comments
 (0)