While Loop and tuple in Python | Find type of element and tuple with one element

While Loop and tuple in Python | find the type of element and tuple with one element

Tuple in python: Tuple is a collection of Python objects separated by a comma. In some instances, a tuple indexing is similar to a list in terms of nested objects and iterations but is immutable as opposed to tuple lists that are mutable.

Learn Basic about Python:

Note: If tule is produced with a single element, be sure to add a comma after the element. To know more about tuple Click here.

While Loop and tuple in Python

How do you use a while loop in Python?

Python has two primitive loop commands among them one is a while loop. With the while loop, we can execute a set of statements as long as a condition is true.

While loop example

# let one of the simple example of while loop
sum = 0
i = 1
while i <= n:
   sum = sum + i
print(” The total sum is:”, +sum)

How to find the data types of elements in python?

It’s simple to find data types in python. You can see below, I have given some example which will help to find the types of elements.

Recommended Post:

Leave a Reply

%d bloggers like this: