Ashvin | From Java to Python: A Student's Journey Transitioning from APCS to Python Programming
Learning a new programming language can be an exciting yet daunting experience. As someone who recently completed the AP Computer Science syllabus, which is primarily focused on Java, I decided to dive into Python, a language known for its simplicity and versatility. In this blog post, I’ll share my journey of transitioning from Java to Python, explore the key differences between the two languages, and provide tips for those looking to expand their programming toolkit.
Understanding Java Through the AP CS A Syllabus
Class 32 (31 August 2024)
a) Class Summary:
- Core Concepts Covered: The video thoroughly explains essential topics like the compareTo
method, 2D arrays, and the basics of Object-Oriented Programming (OOP), including how to build constructors and add students to a system.
- Practical Implementation: It guides students through implementing 2D arrays, finding the best student by GPA, and debugging, providing hands-on practice with these concepts.
b) Video (Saturday):
- Part 1: Understanding compareTo
, 2D Arrays, and Object-Oriented Programming
- Part 2: Implementing 2D Arrays and Finding the Best Student by GPA
- Part 3: Building Constructors, Adding Students, and Debugging 2D Arrays
d) Files:
- Building 2D arrays of Objects
e) Class Code:
- n/a
f) Exercises:
- Write sorted strings to a text file
g) HomeWork Solutions Posting (FB) :
- post answers or link to answer files
Class 33 (3 Sept 2024) <------Started python Classes
a) Class Summary:
- To be updated
b) Video (Tuesday):
- Part 1:
- Part 2: Learning Python Basics After AP CS A: Exploring Python with Live Code Examples
- Part 3: Mastering Python Loops After AP CS A: Hands-On Coding for Beginners
d) Files:
- Python Intro
- Slide 2 Branching & Iteration - part 1
- Reminders on how we implemented this in Java
e) Class Code:
- n/a
f) Exercises:
- Improve the lost in forest Code Exercise
g) HomeWork Solutions Posting (FB) :
- post answers or link to answer files
Class 34 (7 Sept 2024)
a) Class Summary:
- To be updated
b) Video (Satuday):
- Part 1: Transitioning from Java to Python: Mastering Loops, Breaks, and Ranges
- Part 2: Learning Python Basics After AP CS A: Exploring Python with Live Code Examples
- Part 3: String Manipulation and Loops in Python
d) Files:
- Slide 2: Iteration and Branching
- Slide 3: Strings & Slicing - Part 1
e) Class Code:
- n/a
f) Exercises:
- Extract a specific character from a string using slicing
g) HomeWork Solutions Posting (FB) :
- post answers or link to answer files
Class 35 (10 Sept 2024)
a) Class Summary:
-
Handling Loops and Conditional Statements in Python: The class covered how to use and control both for loops and while loops in Python, along with integrating if statements for condition-based logic.
-
Debugging and Loop Control: Students learned debugging techniques to identify and fix infinite loops, focusing on understanding the flow of loop control when transitioning from Java to Python.
-
Mastering Logical Thinking in Python: The class explored deeper logical thinking, helping students transition Java concepts to Python by analyzing and solving real coding problems using Python syntax and logic.
b) Video (Thrusday):
- Part 1: Handling Loops and Conditional Statements in Python
- Part 2: Debugging and Loop Control: Transition from Java to Python
- Part 3: Transitioning from Java to Python: Mastering Logical Thinking Through Code Exploration
d) Files:
- Slide 3: String Manipulation and Bisection Search
e) Class Code:
- n/a
f) Exercises:
- Solve Problem 1 from Ps1 - MIT
g) HomeWork Solutions Posting (FB) :
- post answers or link to answer files
Class 36 (14 Sept 2024)
a) Class Summary:
-n/a
b) Video (Saturday):
- Part 1: Python for Java Programmers: Leveraging Abstraction and Decomposition
- Part 2:
- Part 3: Understanding Python Scopes and Function Behaviors for Java Programmers
d) Files:
- Module 4: Building Methods & Variable Scopes
e) Class Code:
- n/a
f) Exercises:
- Solve Problem 1 from Ps1 - MIT
g) HomeWork Solutions Posting (FB) :
- post answers or link to answer files
Class 37 (17 Sept 2024)
a) Class Summary:
-
Java vs. Python Programming Concepts: Ahmed and Ash discussed the differences between Java and Python, focusing on global variables, function definitions, and swapping variables in Python. They explored returning multiple values from functions using tuples and discussed the mutability of lists versus the immutability of tuples.
-
Python-Specific Topics and Troubleshooting: They examined loops, lists, and object manipulation in Python. Ahmed guided Ash through error resolution related to function input and variable handling, and they discussed various Python-specific concepts, such as the flexibility of lists and how to handle tuple input and printing. Ash was advised to practice Python concepts like loops, list methods, and type conversion.
b) Video (Tuesday):
- Part 1: Python Fundamentals for Java Students: Tuples, Lists, and Loops
d) Files:
e) Class Code:
- n/a
f) Exercises:
- Tuple Code Explanation Homework
g) HomeWork Solutions Posting (FB) :
- post answers or link to answer files
Class 38 (21 Sept 2024)
a) Class Summary:
- Game Development Insights: Ash and Ahmed discussed Ash's game project, focusing on storage considerations and teamwork in game development, with Ash playing key roles as an animator and minor scripter.
- Python List Operations: They explored Python's
append
vs.extend
, sorting techniques (sort()
vs.sorted()
), and the differences between lists and tuples. - Factorials and Code Understanding: Ahmed guided Ash through calculating factorials using loops and understanding the importance of correct indentation and code structure.
- String Splitting and Conversions: They discussed splitting strings based on spaces, converting strings to lists, and resolving related coding challenges.
- Cloning vs. Aliasing: The class highlighted the importance of understanding cloning versus aliasing in programming, especially in Python and Java, to manage memory and variable behavior effectively.
b) Video (Tuesday):
- Part 1: astering Python List Operations, Sorting, and Game Development Techniques
d) Files:
e) Class Code:
- n/a
f) Exercises:
- File Filtering by Extension in Python
g) HomeWork Solutions Posting (FB) :
- post answers or link to answer files
Class 39 (28 Sept 2024)
a) Class Summary:
-
Health Check-in & Troubleshooting: Ash was recovering from a health issue but still able to engage with the class. We initially tackled a technical issue Ash faced while running code, specifically addressing file path issues and proper Python interpreter setup.
-
Key Programming Concepts:
- Lists and Pointers: Explained how Python uses references for lists and demonstrated how modifying a list impacts all references to it. We also covered cloning lists to avoid unwanted changes.
- Internal Counters in Loops: Discussed how Python manages loops internally and common pitfalls when modifying a list inside a loop.
- Recursion: Introduced the concept of recursion, where a function calls itself to solve a problem, and emphasized the importance of a base case to prevent infinite loops.
-
Practical Exercises:
- File Handling & Task List: Ash practiced handling various file formats in a game folder and worked on refining the output formatting of a task list.
- Debugging & Optimization: Identified a logical error in a list manipulation task and discussed approaches for code optimization, particularly when replacing loops with recursive functions.
-
Next Steps:
- Ash will continue practicing recursion and file handling, improve task list formatting, and install Python’s IDLE on his computer to run code locally.
- In future classes, recursion concepts will be explored in more depth.
b) Video (Saturday):
- Part 1: Introduction to Python Programming: Lists, Recursion, and Task Management
d) Files:
e) Class Code:
- n/a
f) Exercises:
- File Filtering by Extension in Python (same exercise not changed for the 3rd time)
g) Quiz Result:
h) HomeWork Solutions Posting (FB) :
- post answers or link to answer files
Class 40 (1 Oct 2024)
a) Class Summary:
- Installed Python 3.7 and resolved issues with the setup.
- Discussed and implemented recursive functions, including factorials and the Fibonacci sequence.
- Explored the Tower of Hanoi problem as an example of recursion.
- Debugged issues in the Fibonacci function and reviewed best practices for code structure.
- Emphasized the importance of understanding base cases in recursive functions to avoid infinite loops or errors.
b) Video (Tuesday):
- Part 1: Python Recursion and Algorithmic Efficiency: Fibonacci, Factorials, and Tower of Hanoi
d) Files:
- Download the slides on recursion, factorials, and the Tower of Hanoi here
e) Class Code:
- n/a
f) Exercises:
- File Filtering by Extension in Python (same exercise not changed for the 4th time)
- Download the Towers of Hanoi code explanation and exercise
g) Quiz Result:
- No Quiz in this class
h) HomeWork Solutions Posting (FB) :
- post answers or link to answer files