Ad Code

Responsive Advertisement

Basic Python Program - 29

Question 29: Create a tuple and find the minimum and maximum number from it.
Download hole Program / Project code, by clicking following link:
Define empty tuple. Write syntax to create empty tuple in python ?
An empty tuple in Python is a tuple that contains no elements. It is represented by a pair of parentheses with nothing inside them. Here's the syntax to create an empty tuple in Python:
empty_tuple = ()

Here's an example:
empty_tuple = ()
print(empty_tuple)


Output: ()

In this example, empty_tuple is an empty tuple containing no elements. You can use this empty tuple to store elements later or for any other purpose where an empty ordered collection is required.
Programming Code:
Following code write in: BP_P29.py
# Find min & max number from tuple

# create tuple

tuple1 = (12, 15, 25, 35, 20, 4, 23)

print("Tuple is: ", tuple1)

print("Minimum number is: ", min(tuple1))       # min(), function

print("Maximum number is: ", max(tuple1))       # max(), function

# Thanks for Reading.
Output:


Post a Comment

0 Comments

Ad Code

Responsive Advertisement