Code Monkey home page Code Monkey logo

Comments (2)

github-learning-lab avatar github-learning-lab commented on June 2, 2024

🎉 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.

github-learning-lab avatar github-learning-lab commented on June 2, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.