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.
- Python Hello World Program
- Python Comment | Creating a Comment | multiline comment | example
- Python Dictionary Introduction | Why to use dictionary | with example
- How to do Sum or Addition in python
- Python Reverse number