Python

How to check the keywords in python? Syntax for python and Different ways of running python script

How to check the keywords in python?

The number of keywords in python changes frequently. In some cases keywords are converted to     built -in functions. for example exec and print were the keywords in python 2.7 but in python 3 + they are converted as built in functions.

To check the list of  keywords in python  type

Help(“keywords”)

Then it will display the list of keywords in python.

Syntax for python

  • Syntax for any programming language is the set of rules that defines how a program should be written and interpreted.
  • In python we can type the code in the command line prompt and execute  directly.

Different ways of running python script

There are different ways of running python script

Interactive Mode

  • One of the most widely used way of running python script is interactive mode.
  • To execute the code in interactive mode simply go to command prompt and type python .Then it will display the information of python version installed in your pc.
  • Next, type the code and hit enter.

Example:

Here in the above the print function is used to print the text whatever inside the parenthesis.

Here  we are entering the text  that means it is in string format so it should be mentioned either  in single quote or double quote.

Example 2:

You can run more than two lines code in interactive mode.

Note:  To get out of this mode  press ctrl +Z  or  type exit() and press enter.

PyCharm IDE

Torun the python code using an IDE like  PyCharm. The following steps should be followed.

  1. Install PyCharm IDE and set environment path variable.
  2. Open the Pycharm IDE.
  3. Create a new project
  4. Specify a name to the project.
  5. Write the code and run.
  6. Code is executed.

Note:  The advantage of using interpreter like Py Charm is that the file is not required  to save with .py extension. It automatically saved with .py extension

Lakshmi Durga

Share
Published by
Lakshmi Durga

Recent Posts

Samsung TV Red Light Blinking? 4 Fixes (2026 Power Logic Hub)

User Problem Scenario: The Red Light "Panic" You press the power button on your Samsung…

5 days ago

Samsung TV Not Connecting to WiFi: 2026 Easy Fix Guide

Introduction: I Know the Feeling "We’ve all been there. You sit down to watch your…

6 days ago

Samsung TV Restarting During Diagnosis? Fix the Reboot Loop Fast

User Problem Scenario: The "Diagnosis Loop" Paradox Imagine you notice your apps are slow. You…

7 days ago

Samsung TV Optimize Now Not Working? (2026 Fix: Greyed Out, Stuck or Not Responding)

🎓 Technical Module: Memory Maintenance Logic Module: WV-OS-307 Verified 2026 👨‍🏫 Instructor: Vangari Divya (M.Tech)…

1 week ago

Samsung Smart Hub Test Failed? (2026 Fix: DNS, ISP Block & Authentication Error)

 Introduction: The Setup Paradox "There is a specific moment of frustration for every Samsung Smart…

2 weeks ago

Samsung TV Picture Test Not Working? 4 Technical Recovery Fixes

Introduction: Lab Diary & Experience "When your Samsung TV screen begins to flicker or show…

2 weeks ago