Page 112 - Trackpad_V2.1_class8
P. 112
You will get the following output:
Output
Hello Orange! How do you do?
Program 2: To add two numbers using user-defined function
Program2.py
File Edit Format Run Options Window Help
#Program that demonstrate to create a user-defined function
def add (a, b):
c = a+b
print("The sum of both the numbers is", c)
add (12, 16)
You will get the following output:
Output
The sum of both the numbers is 28
PURE Approximately, 1.4% of all websites on the Internet use Python as a server-side
FACT programming language.
STRING
A sequence of characters which is enclosed or surrounded by single (' '), double (" "), or Triple
(''' ''') quotes is known as a string. The sequence may include a letter, number, special characters
or a backslash. Python treats single quotes as double quotes.
Program 3: To print a string
Program3.py
File Edit Format Run Options Window Help
str = "This is Shweta's pen." Output
print(str) This is Shweta's pen.
110 Trackpad (V2.1)-VIII

