[go: up one dir, main page]

0% found this document useful (0 votes)
9 views2 pages

Programing

This document provides a step-by-step guide for beginners to create a simple sum calculator using Python. It covers setting up the environment, writing the code, saving the file, and running the program. The example demonstrates user input, basic calculations, and output display in Python.

Uploaded by

qkwwjyj6j8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

Programing

This document provides a step-by-step guide for beginners to create a simple sum calculator using Python. It covers setting up the environment, writing the code, saving the file, and running the program. The example demonstrates user input, basic calculations, and output display in Python.

Uploaded by

qkwwjyj6j8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

programing

**Title: Getting Started with Python: A Simple Sum Calculator**

**Step 1: Setting Up Your Environment**

Ensure you have Python installed on your computer. You can download it from
the official Python website (https://www.python.org/downloads/).

**Step 2: Open a Text Editor**

Open a text editor of your choice. For beginners, using a simple text editor
like Notepad on Windows or TextEdit on macOS is sufficient. Advanced code
editors like Visual Studio Code or PyCharm are also great options.

**Step 3: Writing Your First Python Program**

Type the following code into your text editor:

```python
# Simple Sum Calculator

# Get user input for the first number


num1 = float(input("Enter the first number: "))

# Get user input for the second number


num2 = float(input("Enter the second number: "))

# Calculate the sum


sum_result = num1 + num2

# Display the result


print("The sum of", num1, "and", num2, "is:", sum_result)
```

**Step 4: Save Your Program**

Save your file with a ".py" extension, for example, "sum_calculator.py". This is
the standard extension for Python files.

**Step 5: Run Your Program**

Open a terminal or command prompt, navigate to the folder where you saved
your file, and type:

```bash
python sum_calculator.py
```

Press Enter, and your program will run. Enter two numbers as prompted, and
it will display their sum.
Congratulations! You've just created and run your first Python program. This
simple example introduces you to user input, basic calculations, and
displaying output in Python. Feel free to explore and modify the code as you
continue your programming journey.

You might also like