If you know JavaScript, Python takes a weekend, not a semester. Same concepts, cleaner syntax.
The translation table
# JavaScript โ Python
# const x = 5 โ x = 5
# if (a && b) {} โ if a and b:
# arr.map(f) โ [f(x) for x in arr] # list comprehension
# obj.name โ obj["name"] or obj.name (classes)
# console.log() โ print()
# null / undefined โ NoneThe data structures
marks = [88, 92, 79] # list (array)
student = {"name": "Priya", "cgpa": 8.9} # dict (object)
point = (10, 20) # tuple (immutable)
unique = {1, 2, 3} # set
total = sum(m for m in marks if m > 80)
name = student.get("name", "Unknown")Web hello-world with Flask
from flask import Flask, jsonify
app = Flask(__name__)
@app.route("/api/hello")
def hello():
return jsonify(message="Hello from Python!")
app.run(port=5000)Gotchas from JS: indentation IS syntax (no braces), / always returns float, and there is no ++. Python opens data science doors too โ one weekend, two career paths.