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 tuples 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, that I have given some examples that will help to find the types of elements.

Recommended Post:

Pramod Kumar Yadav is from Janakpur Dham, Nepal. He was born on December 23, 1994, and has one elder brother and two elder sisters. He completed his education at various schools and colleges in Nepal and completed a degree in Computer Science Engineering from MITS in Andhra Pradesh, India. Pramod has worked as the owner of RC Educational Foundation Pvt Ltd, a teacher, and an Educational Consultant, and is currently working as an Engineer and Digital Marketer.



Leave a Comment