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

Python_Basics_Explanation

Python is a high-level programming language known for its readability and versatility, used in various fields such as web development and data science. It features a simple syntax, a large community, and numerous libraries, making it popular among companies like Google and Netflix. The document covers the basics of Python, including installation, variables, data types, input/output, and operators, along with practice tasks for beginners.

Uploaded by

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

Python_Basics_Explanation

Python is a high-level programming language known for its readability and versatility, used in various fields such as web development and data science. It features a simple syntax, a large community, and numerous libraries, making it popular among companies like Google and Netflix. The document covers the basics of Python, including installation, variables, data types, input/output, and operators, along with practice tasks for beginners.

Uploaded by

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

Python Basics - Beginner Explanation

1. What is Python?

- Python is a high-level, easy-to-read programming language.


- It is used for web development, automation, data science, AI, and more.
- Python was created by Guido van Rossum and released in 1991.

2. Why Learn Python?

- Simple and readable syntax (like English).


- Large community and lots of libraries.
- Used by companies like Google, Instagram, Netflix, NASA.

3. Installing Python

- Visit https://www.python.org and download the latest version.


- Use an IDE like IDLE (built-in), VS Code, or PyCharm.
- To run code: use an editor or Python shell.

4. Your First Program

print("Hello, World!")
- This prints a message to the screen.
- `print()` is a built-in function used for output.

5. Comments in Python

# This is a comment
- Comments are ignored by Python and used for explaining code.

6. Variables

- Variables store values.


Example:
name = 'John'
age = 15

7. Data Types

- int: Whole numbers (e.g., 5, 100)


- float: Decimal numbers (e.g., 3.14)
- str: Text in quotes (e.g., "Hello")
- bool: True or False

8. Input and Output

name = input("What is your name? ")


print("Hello", name)
- `input()` gets user input as a string.

9. Type Conversion

num = int(input('Enter a number: '))


print(num * 2)
- Use int(), float(), str() to change types.

10. Operators

+ Addition (a + b)
- Subtraction (a - b)
* Multiplication (a * b)
/ Division (a / b)
// Floor Division (a // b)
% Modulus (a % b)
** Power (a ** b)

11. Practice Tasks

- Write a program that asks for your name and age.


- Write a program that adds two numbers input by the user.
- Try printing your favorite quote using `print()`.

You might also like