filmov
tv
Python 3 Basics # 3.1 | Receiving input in python | Python Type Conversion | Python input function
![preview_player](https://i.ytimg.com/vi/5UcysrGQ4Vo/sddefault.jpg)
Показать описание
Python 3 Basics # 3.1 | Receiving input in python | Python Type Conversion | Python input function
Python Basics - Session # 9
Topic to be covered -
1. Receiving inputs in Python
2. Type conversion
The input() method reads a line from input, converts into a string and returns it.
The syntax of input() method is: input([prompt])
input() Parameters
The input() method takes a single optional argument:
prompt (Optional) - a string that is written to standard output (usually screen) without trailing newline
The process of converting the value of one data type (integer, string, float, etc.) to another data type is called type conversion. Python has two types of type conversion.
Implicit Type Conversion and Explicit Type Conversion
Code Starts Here
==============
name = input('enter your name : ')
print(name)
favourite_food = input('enter your favourite food : ')
print(name + ' loves ' + favourite_food)
account_balance = 50000
salary = input('enter the salary credited : ')
final_balace = account_balance + int(salary)
print('Final amount in the account :',final_balace)
celcius to farenheit conversion
temp_in_celcius = int(input('enter the temp in celcius : '))
print('Temperature entered in celcius is :', temp_in_celcius)
C/5 = (F-32)/9
F = 9 * C/5 + 32
temp_in_farenhiet = 9 * temp_in_celcius/5 + 32
print('temp in farenheit is :', temp_in_farenhiet)
All the playlist of this youtube channel
===============================
1. Data Preprocessing in Machine Learning
2. Confusion Matrix in Machine Learning, ML, AI
3. Anaconda, Python Installation, Spyder, Jupyter Notebook, PyCharm, Graphviz
4. Cross Validation, Sampling, train test split in Machine Learning
5. Drop and Delete Operations in Python Pandas
6. Matrices and Vectors with python
7. Detect Outliers in Machine Learning
8. TimeSeries preprocessing in Machine Learning
9. Handling Missing Values in Machine Learning
10. Dummy Encoding Encoding in Machine Learning
11. Data Visualisation with Python, Seaborn, Matplotlib
12. Feature Scaling in Machine Learning
13. Python 3 basics for Beginner
14. Statistics with Python
15. Data Preprocessing in Machine Learning
16. Sklearn Scikit Learn Machine Learning
17. Linear Regression, Supervised Machine Learning
18 Interview Questions on Machine Learning, Artificial Intelligence, Python Pandas and Python Basics
19. Jupyter Notebook Operations
Python Basics - Session # 9
Topic to be covered -
1. Receiving inputs in Python
2. Type conversion
The input() method reads a line from input, converts into a string and returns it.
The syntax of input() method is: input([prompt])
input() Parameters
The input() method takes a single optional argument:
prompt (Optional) - a string that is written to standard output (usually screen) without trailing newline
The process of converting the value of one data type (integer, string, float, etc.) to another data type is called type conversion. Python has two types of type conversion.
Implicit Type Conversion and Explicit Type Conversion
Code Starts Here
==============
name = input('enter your name : ')
print(name)
favourite_food = input('enter your favourite food : ')
print(name + ' loves ' + favourite_food)
account_balance = 50000
salary = input('enter the salary credited : ')
final_balace = account_balance + int(salary)
print('Final amount in the account :',final_balace)
celcius to farenheit conversion
temp_in_celcius = int(input('enter the temp in celcius : '))
print('Temperature entered in celcius is :', temp_in_celcius)
C/5 = (F-32)/9
F = 9 * C/5 + 32
temp_in_farenhiet = 9 * temp_in_celcius/5 + 32
print('temp in farenheit is :', temp_in_farenhiet)
All the playlist of this youtube channel
===============================
1. Data Preprocessing in Machine Learning
2. Confusion Matrix in Machine Learning, ML, AI
3. Anaconda, Python Installation, Spyder, Jupyter Notebook, PyCharm, Graphviz
4. Cross Validation, Sampling, train test split in Machine Learning
5. Drop and Delete Operations in Python Pandas
6. Matrices and Vectors with python
7. Detect Outliers in Machine Learning
8. TimeSeries preprocessing in Machine Learning
9. Handling Missing Values in Machine Learning
10. Dummy Encoding Encoding in Machine Learning
11. Data Visualisation with Python, Seaborn, Matplotlib
12. Feature Scaling in Machine Learning
13. Python 3 basics for Beginner
14. Statistics with Python
15. Data Preprocessing in Machine Learning
16. Sklearn Scikit Learn Machine Learning
17. Linear Regression, Supervised Machine Learning
18 Interview Questions on Machine Learning, Artificial Intelligence, Python Pandas and Python Basics
19. Jupyter Notebook Operations