-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasic.py
More file actions
49 lines (44 loc) · 1.79 KB
/
Copy pathBasic.py
File metadata and controls
49 lines (44 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# =====================================================================
# FILE: Basic.py
# DESCRIPTION: Basic output, input, and python design history/pros/cons.
#
# SYNTAX QUICK-REFERENCE:
# print("Hello World")
# # input() takes string console input:
# name = input("Enter name: ")
# =====================================================================
# Basic.py
# Reference Guide: Python History, Definition, Advantages, and Print/Input Basics
# ==========================================
# 1. WHAT IS PYTHON?
# ==========================================
# Python is a high-level, interpreted, general-purpose programming language.
# It was created by Guido van Rossum and first released in 1991.
# Key features:
# - Dynamically typed (type is checked at runtime)
# - Garbage-collected (automatic memory management)
# - Supports multiple programming paradigms: Procedural, Object-Oriented, and Functional.
print("--- 1. BASIC OUTPUT & INPUT ---")
# Print statement example
print("Hello World")
# Input statement example (Simulated here)
# In actual use: name = input("Enter your name: ")
simulated_input = "Alice"
print(f"Hello {simulated_input} (via simulated input)")
print()
# ==========================================
# 2. PROS AND CONS OF PYTHON
# ==========================================
# Advantages:
# 1. Easy to learn and read (simple syntax)
# 2. Large standard library & rich ecosystem
# 3. Platform independent (runs on Windows, Mac, Linux)
# 4. Rapid prototyping and development speed
# 5. Massive community support
#
# Disadvantages:
# 1. Slow execution speed compared to compiled languages (like C/C++)
# 2. High memory consumption due to dynamic typing
# 3. Not ideal for mobile app development
# 4. GIL (Global Interpreter Lock) limits true multi-core CPU performance in multithreading
print()