Python reversed() Function

Python Programming Training Certification


Flexible Hours

100 Assignments

Instructor Led online Training

50 LMS Access

24X7 Support

100% Skill Level

Enquire Now

4.9 out of 1000+ Ratings
Best Python Institute for Learning Python Course & Training, Live Project Training in Python with Django, Data Science and AI, Interview Assistance, Expert Coaching Trainers. Python Certification & Interview Assistance! Get free demo now!

Course Overview

Python is one of the world’s top programming languages used today and Python training has become the most popular training across individuals. Training Basket’s Python Training & Certification course covers basic and advanced Python concepts and how to apply them in real-world applications.Python is a flexible and powerful open-source language that is easy to learn and consists of powerful libraries for data analysis and manipulation. Our Python training course content is curated by experts as per the standard Industry curriculum. The curriculum, coding challenges and real-life problems cover data operations in Python, strings, conditional statements, error handling, shell scripting, web scraping and the commonly used Python web framework Django. Take this Python training and certification course and become job-ready now.

Python reversed() Function

Python reversed() function returns the reversed iterator of the given sequence.

Signature

  • reversed(sequence)

Parameters

sequence: It is a sequence that needs to be reversed.

Return

It returns the reversed iterator of the given sequence.

Python reversed() Function Example 1

The above example shows the working of reversed for a sequence: string, tuple, list, and range.

  • # for string
    String = ‘Java’
    print(list(reversed(String)))

    # for tuple
    Tuple = (‘J’, ‘a’, ‘v’, ‘a’)
    print(list(reversed(Tuple)))

    # for range
    Range = range(8, 12)
    print(list(reversed(Range)))

    # for list
    List = [1, 2, 7, 5]
    print(list(reversed(List)))

Output:

  • [‘a’, ‘v’, ‘a’, ‘J’]
    [‘a’, ‘v’, ‘a’, ‘J’]
    [11, 10, 9, 8]
    [5, 7, 2, 1]

Explanation:

In the above example, we have taken a string that consists the value “Java“, and it prints the reversed string value as the output.

In the second case, we have taken a tuple value that consists of the same value, and it prints the reversed tuple value as the output.

In the third case, we have taken a range that consists of a range of numeric values, and it prints the reversed range values as output.

In the fourth case, we have taken a list that consists of some numeric values, and it prints the reversed list value as output.

Recently Trained Students

Jessica Biel

– Infosys

My instructor had sound Knowledge and used to puts a lot of effort that made the course as simple and easy as possible. I was aiming for with the help of the ZebLearn Online training imparted to me by this organization.

Richard Harris

– ITC

I got my training from Zeblearn in the Python Certification Training, I would like to say that say he is one of the best trainers. He has not even trained me but also motivated me to explore more and the way he executed the project, in the end, was mind-blowing.


Candidate’s Journey During Our Training Program

Card image cap

Expert’s Advice & Selection of Module

Choosing the right type of module for the training is half the battle & Our Team of experts will help & guide you.

Card image cap

Get Trained

Get Trained & Learn End to End Implementation from our Expert Trainer who are working on the same domain.

Card image cap

Work on Projects

We Do make our student’s work on multiple case studies , scenario based tasks & projects in order to provide real-time exposure to them.

Card image cap

Placements

We have a dedicated placement cell in order to provide placement assistance & relevant interviews to our candididates till selection

Placement Partner

×

Leave your details

×

Download Course Content