---
title: "What does len() mean in python, and what is the difference between raw_input and input?"  
description: "What does len() mean in python, and what is the difference between raw_input and input?"  
author: "samay srivastava"  
published: 2018-03-08  
canonical: https://answers.mindstick.com/qa/37401/what-does-len-mean-in-python-and-what-is-the-difference-between-raw_input-and-input  
category: "programming"  
tags: ["programming language"]  
reading_time: 1 minute  

---

# What does len() mean in python, and what is the difference between raw_input and input?

What does len() [mean](https://www.mindstick.com/forum/161423/how-does-angular-handle-dependency-injection-and-why-is-it-important-in-a-mean-application) in [python](https://www.mindstick.com/articles/23325/3-amazing-python-news-and-opinion-podcasts), and what is the [difference](https://www.mindstick.com/blog/398/difference-between-object-type-and-var-type) between raw_input and [input](https://www.mindstick.com/interview/1546/html5-input-elements)?

## Answers

### Answer by Prakash nidhi Verma

**len():** Python string length function which counts the length of the string.**len()** function is an inbuilt function in **Python** that returns the length of the string. **Syntax:**

```
len(string) example: list1, list2 = [12, 'mindstick', 'software'], [54, 'prakash'] print "First list length : ", len(list1)print "Second list length : ", len(list2)
```

```
// Length of below string is 9. string = "mindstick"print(len(string))
```

**Difference between raw_input() and input() functions in Python:** The function raw_input() presents a prompt to the user arg of raw_input([arg])) gets input from the user and returns the data input by the user in a string.

```
name = raw_input("What is your name? ") print "mindstick, %s" %name
```

This differs from **input()** in that the latter tries to interpret the input given by the user; it is usually best to avoid **input()** and to stick with **raw_input()** and **conversion code.**

```
name = input("What is your name? ")print("mindstick, %s." %name)
```

```
name = eval(raw_input("what is your name?")) what is your name?mindstick
```

\


---

Original Source: https://answers.mindstick.com/qa/37401/what-does-len-mean-in-python-and-what-is-the-difference-between-raw_input-and-input

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
