---
title: Python User Input
description: "> ## Python User Input –Python Хэрэглэгчийн Оролт ## User Input – **Хэрэглэгчийн Оролт**  Python allows for user input. Python хэл нь хэрэглэгч оролт авах боломжийг олгодог. That means we are able to ask the user for input. Энэ нь бид…"
url: "https://apprentice.mn/docs/python-user-input/"
updated: "2024-07-31"
category: Python
---

# Python User Input

> ## Python User Input –Python Хэрэглэгчийн Оролт

## User Input – **Хэрэглэгчийн Оролт** 

Python allows for user input.

Python хэл нь хэрэглэгч оролт авах боломжийг олгодог.

That means we are able to ask the user for input.

Энэ нь бид хэрэглэгчээс мэдээлэл авах боломжтой гэсэн үг юм.

The method is a bit different in Python 3.6 than Python 2.7.

Энэ арга нь Python 3.6 болон Python 2.7 хувилбаруудад өөр өөр байдаг.

Python 3.6 uses the `input()` method.

Python 3.6 хувилбарт `input()` аргыг ашигладаг.

Python 2.7 uses the `raw_input()` method.

Python 2.7 хувилбарт `raw_input()` аргыг ашигладаг.

The following example asks for the username, and when you entered the username, it gets printed on the screen:

Доорх жишээ нь хэрэглэгчийн нэрийг асууж, хэрэглэгчийн нэрийг оруулсны дараа дэлгэцэн дээр хэвлэгдэнэ:

##### Python 3.6

`username = input("Enter username:")print("Username is: " + username)`

##### Python 2.7

`username = raw_input("Enter username:")print("Username is: " + username)`

Python stops executing when it comes to the `input()` function, and continues when the user has given some input.

`input()` функцэд ирэхэд Python програм ажиллахаа больж, хэрэглэгчийн өгсөн оролтын дараа үргэлжлүүлэн ажилладаг.

                   [https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fapprentice.mn%2Fdocs%2Fpython-user-input%2F&linkname=Python%C2%A0User%20Input](https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fapprentice.mn%2Fdocs%2Fpython-user-input%2F&linkname=Python%C2%A0User%20Input)[https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Fapprentice.mn%2Fdocs%2Fpython-user-input%2F&linkname=Python%C2%A0User%20Input](https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Fapprentice.mn%2Fdocs%2Fpython-user-input%2F&linkname=Python%C2%A0User%20Input)[https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Fapprentice.mn%2Fdocs%2Fpython-user-input%2F&linkname=Python%C2%A0User%20Input](https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Fapprentice.mn%2Fdocs%2Fpython-user-input%2F&linkname=Python%C2%A0User%20Input)[https://www.addtoany.com/share](https://www.addtoany.com/share)
