Comments (2)
🎉 Good job! You just pushed your first Python code! Now let's try making some changes...
Notice that the first and last lines of the Python file reference main()
. That's a Python function and it runs automatically every time you call the script. But only because we told it to.
Try changing the name to something else--almost anything, as long as it doesn't have spaces and isn't a reserved word.
Maybe use a synonym of main, such as primary
.
The important thing is to change it in both places, the first line and the last line.
Now run your code again: python get-quote.py
or python3 get-quote.py
If you get an error, you might have only changed main
in one place, or removed the important ()
from after the name. You'd also get an error if you changed that __main__
thing (line 10), so leave that one be.
Push your changes
When your Python script is running, you'll see the quote again.
To move on to the next step, push your changes:
git add get-quote.py
git commit -m "Renamed the primary function"
git push
When I see the push come through, I'll share your next steps!
from python-random-quote.
Learning the things you can change and the things you can't is a big part of programming.
Next we'll read from our quotes file, taking a step toward building the quote bot.
You can track your progress in this new issue.
from python-random-quote.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-random-quote.