Two lines of Python can do the work of 10 or 15 in other languages
Online advice often warns that picking Python as a primary language will narrow the jobs open to you. Data product management intern Ayushi Gupta, a student at Bhilai Institute of Technology, pushes back by coding live: a working translator built on an API, then a model that predicts house prices. The open question is how much a language designed for readability can really do for a beginner.
Follow two working Python demos, an API translator and a house price model, step by step
Ayushi Gupta argues that Python lets developers focus on building solutions rather than wrestling with syntax, and that choosing it as a primary language does not limit career options. She surveys Python's uses in web development, data and AI, then walks through two live Colab demos: a translator built on the Google Translate API and a linear regression model that predicts house prices.
“As someone has already said, life's better without braces. So why not agree to that?”
“So yeah, as I've already discussed how Python focuses more on developing solutions rather than focusing on the syntax.”
What you will learn
Explain why Python's readability and brevity matter when teams inherit each other's code.
Identify where Python is used, from Django and Flask web apps to big data, machine learning and web crawling.
Call a third-party API from Python with the requests library and check the status code and response.
Prepare a dataset for linear regression by filling null values, encoding categorical columns and scaling features.
Compare a multivariate regression model with a single-variable model using mean squared error.
Key takeaways from the speaker
API
machine-learning
problem-solving
python3
Details
Level
Beginner
Format
Tech talk
Technical depth
Practitioner
For
Student, Early career, Career changer
Length
27:29
Published
June 2021
Questions this talk answers
Why learn Python instead of C, C++ or Java?
Ayushi says Python lets you focus on the solution rather than the syntax, so something that takes 10 or 15 lines elsewhere can take two or three lines. She adds that the right language also depends on which one resonates with the individual.
What can Python be used for?
She lists web development, game development, data science and analytics, big data tools such as Apache Spark, machine learning, deep learning, reinforcement learning, web crawling and embedded applications.
Which Python web frameworks are most popular?
Django is the most popular, followed by the microframework Flask, with others such as web2py also available.
How do you call an external API from Python?
In her demo she encodes the query, builds a payload with source and target languages, and sends a POST request to the Google Translate endpoint with the requests library, then prints the status code and response text.
How do you prepare data before training a linear regression model?
She fills null values in the total bedrooms column with the column mean, label-encodes the categorical ocean proximity column and normalizes features with a min-max scaler before splitting into training and test sets.
About this talk
Python is used for computational problem, for backend, for building ml models, and for most research problems. There are many resources on Internet which says that chossing python as the primary language will restrict the job roles available, and choosing C/C++/Java might be the good option. These information is misleading and many people might not know the magic of Python as a High level language.
Speaker: Okay, so let's get started. So I'll be speaking on the topic, the world of Python. So what my talk will consist of is how Python, like other languages, not just focuses on the syntax of the code, but focuses more on how we develop the solution and how we develop the solution. Speaker: How clearly and readable is the code. So you can visit the slides and collab file, the code which I'll be using through this website.
Speaker: If you want, if some of you want to follow along, you can, you know, create the copy of the collab file and you can like we can code together. Speaker: I'm waiting for a half minute so that if anybody wants to open the slides or the collab file, they can in in the other tab. Speaker: Okay, so let's move forward. So what exactly is Python? As someone has already said, life's better without braces. So why not agree to that? Python is a high level, high level language. It's object oriented. And yeah, it can be useful.
Speaker: Yeah, it can be useful for like various application. We'll see each of the application in the upcoming slides. And yeah. Speaker: So why Python? Why not some other languages like C, C++, Java, JavaScript and just many more, right? So here are some of the reasons why you should be learning Python and. Speaker: And you know, not some other languages, but it's like more dependent on the individuals like who, which languages resonates with the individual. I'll share an interesting story at the end.
Speaker: So yeah, as I've already discussed how Python focuses more on developing solutions rather than focusing on the syntax. The same thing which we can write in Python in a few lines of code, suppose two or three lines of code. The same code request. Like in some of the other languages, we need to write the same code for the same code.
Speaker: The same thing needs to be written in 10 or 15 lines. So yeah, it's better and it's more clear. We can use Python for different applications like web development, game development, data science and data analytics. Speaker: And there are many, you know, you know, softwares with support big data analysis on using Python like Apache spark and many of those are many more in artificial intelligence. Like we can do machine learning, deep learning, or we can use Python for reinforcement learning as well.
Speaker: Web crawling is a very good example. Like web crawling almost every website, websites, even Google uses web crawling to crawl and rank, rank the searches according to the, according to data which they crawl. So yeah, Python can be used for web crawling as well. And we can also use Python to program to create embedded application which can be used for embedded system as well.
Speaker: So yeah, next. Okay. So before we move forward, let's have a quick warmup exercise. In this, I'll be asking some questions and you have to put in the answers in the chat options. And let's see. Okay. So yeah. Here's the first one. You can answer them in the chat option. Speaker 1: Yeah. Answer them in the chat option. I'll be waiting for a half minute on this slide.
Speaker 1: I'll be waiting for half a minute on this slide. Speaker 1: I'll be waiting for half a minute. Speaker 1: Come on, you can answer them on the chat option. Speaker 1: And please let me know if the phones are visible. Speaker 1: Okay, so I've got a few answers here. Speaker 1: Yeah. Speaker 1: Lippin and Lani.
Speaker 1: So are you ready to see the answer? Speaker 1: Okay, let's move forward. Speaker 1: So yeah, this is the answer for, for who have guessed right. Speaker 1: That's something. Speaker 1: Okay, so we'll move forward to the second question. Speaker 1: Hi, Anity. Speaker 1: You can answer this question same as the first one.
Speaker 1: You can answer down in the chat options. Speaker 1: I'm waiting for half half minute here as well. Speaker 2: Hi, Jennifer. Speaker 1: Hi, Jennifer. Thank you. Hi Nikita. Okay, should we move forward? I haven't got answers. So, okay, let's move forward. So, the answer for this one was zero. Okay, then the third and the last one.
Are you guys ready for this? Let's see. This is the last question for warm-up. Then we'll move forward to different technology stacks and how we can use Python for web development and machine learning. Thank you. Yeah, I'm getting some answers. Keep answering. We'll see the answers in a moment. Okay, so should we see the answer? I've got a few answers in the chat option. Yeah, a few of them have guessed it right. Yeah, this is the answer. Let's have a small celebration.
Okay, we'll move forward to... Okay, so we can use Python for web development as well. There are many frameworks like Django and there's microframework like Flask and then there's Portal, Web2Pi and others as well. Django is the most popular one and Flask too. There are many websites which are, you know, many websites which uses Django to develop some of its features.
There's, you can see in the slides as well, Instagram, Mozilla, Pinterest and then some of the websites use Flask for developing its features. There's Airbnb, Netflix, Uber, Samsung, Patreon and there's many more. You can, you know, develop the websites using Python and then it supports HTML, CSS and JavaScript for frontend. You can use developing frontend and yeah.
Okay, so as we are talking about web development, let's just implement our small code using APIs. So in this one, we are going to use Google Translator API to build a translator which converts English language text to Spanish language text. Okay. So are you guys excited? Let's move forward. So yeah, here I have used Python request libraries and codex libraries as, as you can see here. I have taken a source as English language and tag it is Spanish language and here is a query which, which we want to convert from English to Spanish. Here I have created a function. What it does is it takes. It takes a query and it converts all the special characters to its two hex code so that it could be taken as input to the Google API.
Then move forward and we have called this from create query function with the argument query which we have taken and then payload is just a combination of our query tag it and the source languages. And then I've created a function translate it. What it does is takes the end point Google translate endpoint and takes the header I have you can get get your API key through rapid API or and you can also test the same API if you are following along then you can you have the code in on Google collab and the end section and here it calls the request uses the Python request library and it uses a post function with the with this URL and the URL and the URL and the URL and the URL and the URL and the URL and the URL and the payload that we have created and it returns the status code and the response text that we are getting from by hitting the API.
So yeah. So yeah it converted convert our text from English to Spanish. We have called that function with our payload and we are getting the status code and text and I have printed just printed it here so that we can see the state. We have got status code as 200. That means our API call was successful and then we have got the I've got our translated text here. I don't really know how to you know read Spanish but yeah it's something Ola to do something. Okay.
Um this is uh this is uh this is uh the percentage of view how project like this is the projection of views that stack overflow answers have got over the over over a month and how it has you know how it's going to increase the graph for python it has been over increasing increasing over the years and how um how how you know some languages graph for some languages have been depreciating. Yeah most most common reason for this is python has uh uh you know we can write uh more code in less lesser time and the code is more readable because every time.
So it's more readable because every time we work in on organization uh the teams keep changing and uh one team has to work on the codes written by other other person and uh um so and not every time the codes are well documented and has uh comments so yeah let's move forward. So here's what the top website has to say about python the source of these codes are from python.org and you can uh you can uh python.org has the documentation for python and everything you every time you need to you have you face some issues in something you can visit the python.org website and you can um refer to their documentation they have good tutorials as well.
You can view them and you can view them and you can generally learn a lot from there there's um uh there's um uh there's uh well there's also links to uh famous book of pythons in the in the document in the python.org website and then okay so yeah. Okay so yeah so what youtube has to say about python most of these websites the top websites uses python for developing some of the features because uh it's more maintainable and uh uh yeah it's more fun.
So here's what industrial light and magic has to say. Um. uses these python libraries and yeah because in the most of the cases uh we cannot you know create create the each code from scratch we need a community so that they can uh help and help to debug i mean if we are facing some issues they can you know help us and then we can learn and move along together so here we'll be uh performing a small small coding coding tasks and using the python will be predicting house prices using linear regression model so if you guys have any question you can put them in the chat option i'll be waiting for a few minutes here so okay let's move forward so um so i have mentioned it earlier as well if you want to follow along you can
you can go to the collab section collab file and you can see this in the top section okay so here are all the imports that i have used i've used pandas and escalern numpy matplot for plotting the plotting the graphs so um so i have i have taken a housing data data set and i have read uh read uh read it using pandas and stored it in our data frame then i have uh in the next slide i have uh printed the few top few rows of the data set as you can see we have different features like longitude latitude uh housing medium age total rooms total bedrooms etc in the data set and then uh and then and then we have median income ocean proximity and other features you can see all the features
you can see all the features here and we'll be predicting the house house price using using the using all these features so here we'll be using prediction we'll be doing prediction using two ways first multivariate uh using multivariate regression we'll be using all these features to predict the house price and then we'll be using uh median income just medium income and predicting the house price that is uh predicting the house price using one individual income income and predicting the house price that is uh predicting the house price using one independent independent variable so before we move forward we have seen like the in the last slide we have seen the total bedroom columns has some null values in it it as as you can see all the all the data set all the features have uh 20640 values and
total bedrooms have 20433 values and rest of the values are null so before uh training our linear regression model we need to uh have uh pre-process i mean remove the null values and have some values there so that the result are not not misleading so we are just here rechecking if if any else any else column has a null values so i have done it here the next slide i have uh in the next slide the i have taken the total bedrooms column column and i have filled all the null values with the mean of the mean of that column and and then we have ocean proximity uh ocean proximity value it has categorical value all the value all the values you can see here all the value all the features have uh in integer values and float values but ocean proximity has
those object values we need to you know encode that categorical column and yeah so we have done it here using label encoder and then i have just checked the shape of our data data frame which move so before before uh you know training the training the linear regression we have to normalize the value i have used min max scalar for this task and this is how we uh we get the scaled value from the original value it uses this uh transformation i have the transformation here and then it uses the transformation to transform the input data and get get us the scale value then i have just checked the shape of our features and target variable then i have then i have um then i have to train you to train the linear regression using a training set
and tested it on the test set here i have trained the linear regressor using crane data that is x train and y train and then i have predicted the house prices value that is y bread using the x thread x test data then i have calculated the mean squared error using using the those values here we have got 0.214 okay if you have any questions so you can put them in the chat section and after this i'll be predicting the house values using one independent variable that is median income so yeah i have taken the dfx which is uh which is median income uh in the dfx data frame and then we have the target values that is the target values that is house prices values in dfy and then i have spitted them into
test and train data set so here uh i have you know again they um fitted the linear regression with train data set and then i have predicted uh house prices using x test values and in the same way i have calculated the mean squared error this is the plot of our predicted values we have used median income to predict the house prices and here's the fitted line line line which which is used to predict the prices of the house okay so this was the end of this session if you guys have any questions you can put them in the chat you can put them in the chat option and i'll be happy to answer them you
Transcribed automatically; names checked against the speaker record. Select a time to jump there.
Article based on this talk
Does choosing Python limit you? Two live demos say it opens doors
Ayushi Gupta makes the case for Python as a solution-first language and backs it with an API translator and a house price model.
In short
Ayushi Gupta argues that Python is not a limiting first choice, despite online advice that steers learners toward C, C++ or Java. Python's strength, she says, is that it lets developers concentrate on solving the problem rather than on syntax, and it reaches across web development, data science and machine learning. She demonstrates this with two beginner-friendly demos in a shared Google Colab notebook.
Key takeaways
APIs
Machine learning
Problem solving
Python 3
Solutions over syntax
Ayushi opens with a light-hearted definition of Python as a high-level, object-oriented language. "As someone has already said, life's better without braces. So why not agree to that?" (0:46)
Her central argument is about where a developer's attention goes. "So yeah, as I've already discussed how Python focuses more on developing solutions rather than focusing on the syntax." (2:37) She explains that something written in two or three lines of Python can require far more in other languages: "The same thing needs to be written in 10 or 15 lines. So yeah, it's better and it's more clear." (3:05)
She is careful not to turn this into a language war. The right language, she says, also depends on which one resonates with the individual. Readability matters in practice because teams change and people regularly inherit code that is not always well documented or commented.
One language, many fields
Ayushi then maps out where Python shows up: web development, game development, data science and analytics, big data tools such as Apache Spark, machine learning, deep learning and reinforcement learning. She highlights web crawling, noting that search engines such as Google crawl websites to rank results, and adds that Python can also be used to build embedded applications.
On the web side, she introduces the main frameworks. "Django is the most popular one and Flask too." (10:05) As the speaker cited from her slides, Instagram, Mozilla and Pinterest use Django for some features, while Airbnb, Netflix, Uber, Samsung and Patreon use Flask. Python handles the back end and works alongside HTML, CSS and JavaScript for the front end.
She also points to a Stack Overflow chart of question views, where Python's line has kept rising while some other languages decline, and recommends python.org for documentation and tutorials. Community, she stresses, is part of the appeal, because developers rarely write everything from scratch and need others to help them debug and learn.
Demo one: a translator built on an API
The first live demo turns web development into something tangible. "So in this one, we are going to use Google Translator API to build a translator which converts English language text to Spanish language text." (11:04)
Ayushi walks through each step of the notebook:
Set English as the source language and Spanish as the target.
Write a function that converts special characters in the query to hex codes so the API accepts it.
Build a payload combining the query, source and target languages.
Send a POST request to the Google Translate endpoint using the Python requests library, with an API key obtained through RapidAPI.
Print the status code and the response text.
The call succeeds: "We have got status code as 200." (13:14) She notes that a 200 status means the API call worked, and the translated Spanish text appears in the output.
Demo two: predicting house prices
The second demo moves into machine learning, using pandas, scikit-learn, NumPy and Matplotlib to predict house prices with linear regression. The housing dataset includes features such as longitude, latitude, housing median age, total rooms, total bedrooms, median income and ocean proximity.
Ayushi spends much of the demo on preparation, which is where beginners often slip. She checks for missing data and finds that total bedrooms has 20,433 values against 20,640 for the other columns, as the speaker cited from the dataset. She fills the gaps with the column mean so results are not misleading, label-encodes the categorical ocean proximity column, and normalizes features with a min-max scaler.
She then trains a multivariate linear regression model on a training set, predicts on the test set and reports a mean squared error of 0.214. Finally, she repeats the exercise with a single independent variable, median income, and plots the fitted line against the data, showing viewers how one feature compares with many.
Why it matters for learners
The talk is aimed at students and early-career developers deciding where to invest their learning time. Ayushi's message is that Python can carry a learner from small scripts to APIs and machine learning without switching languages, and that clear, readable code is an asset for teams as well as individuals. Because much of the content lives on her slides and in the Colab notebook, viewers will get the most from following along with the code.
Watch the talk
The world of Python, Ayushi Gupta, 27 minutes: https://www.womentech.net/video/world-python
About the speaker
Ayushi Gupta is a student at Bhilai Institute of Technology and a data product management intern at KYCHub, based in Raipur, India. Her talks focus on using Python for algorithmic questions, machine learning models, back-end tasks and other development work, with an emphasis on building solutions rather than worrying about syntax.
Questions this talk answers
Why learn Python instead of C, C++ or Java?
What can Python be used for?
Which Python web frameworks are most popular?
How do you call an external API from Python?
How do you prepare data before training a linear regression model?
Drafted with AI from the talk transcript. Editor review pending.
Frameworks and ideas mentioned
Linear regression
Multivariate regression
Label encoding
Min-max scaling
Mean squared error
Resources mentioned
python.org documentation and tutorials
Speaker's Google Colab notebook and slides
RapidAPI (for a Google Translate API key)
Cite this talk
Ayushi Gupta. "The world of Python." WomenTech Network, 2021. https://www.womentech.net/video/world-python