[Go to site: main page, start]

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

Basic Python Programming Guide

This document is a beginner-friendly guide to Python programming, covering fundamental concepts such as variables, data types, user input, conditions, loops, functions, and lists. It includes a simple first program and practice exercises to reinforce learning. Additionally, it suggests next topics to explore, including Object-Oriented Programming and web development frameworks.

Uploaded by

i22-0605-382
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)
2 views2 pages

Basic Python Programming Guide

This document is a beginner-friendly guide to Python programming, covering fundamental concepts such as variables, data types, user input, conditions, loops, functions, and lists. It includes a simple first program and practice exercises to reinforce learning. Additionally, it suggests next topics to explore, including Object-Oriented Programming and web development frameworks.

Uploaded by

i22-0605-382
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

Basic Python Programming Guide

A beginner-friendly introduction to Python programming.

1. What is Python?
Python is a high-level, easy-to-read programming language used for web development, automation,
data science, cybersecurity, artificial intelligence, and more.

2. Your First Program


print('Hello, World!')
This displays text on the screen.

3. Variables
name = "Christopher"
age = 22
print(name, age)

4. Data Types
str - Text
int - Whole numbers
float - Decimal numbers
bool - True or False

5. User Input
name = input("Enter your name: ")
print("Hello", name)

6. Conditions
age = 18
if age >= 18:
print("Adult")
else:
print("Minor")

7. Loops
for i in range(5):
print(i)

8. Functions
def greet(name):
print("Hello", name)

greet("Christopher")

9. Lists
fruits = ["apple", "banana", "orange"]
print(fruits[0])

10. Files
with open("[Link]", "w") as file:
[Link]("Hello World")
Practice Exercises
1. Create a calculator that adds two numbers.
2. Ask the user for their age and determine if they are an adult.
3. Print numbers from 1 to 100 using a loop.
4. Create a list of five favorite movies and display them.
5. Create a function that returns the square of a number.

Next Topics to Learn


• Object-Oriented Programming (OOP)
• Modules and Packages
• Exception Handling
• APIs
• Web Development with Flask/Django
• Automation and Cybersecurity Scripting

You might also like