
Transition from Java to Python in 100 steps by learning structural and object-oriented Python concepts such as types, modules, collections, and exceptions, with practical examples and exercises using PyCharm.
Discover how to use the course guide: download the PDF, install Python and PyCharm, and search the GitHub repo for Python and Java code, including operator overloading examples.
Install Python 3 on your system and launch the Python shell to start coding. Download the installer for Windows or Mac, add Python to path on Windows, and try print(5*4).
Install PyCharm community edition by downloading from JetBrains, selecting your operating system, running the installer with defaults, choosing a theme, and preparing to create a new project for the course.
Create your first hello world in Java and Python, using Eclipse and PyCharm, and learn Python's print to the console with hello_world.py in a project, including underscore naming conventions.
Explore how Python executes code directly without a main method or class, using either single or double quotes, with no mandatory semicolons, and its history as older than Java.
Import and set up the Java code in Eclipse by downloading the GitHub repository, unzipping it, and importing the Maven project Python-Java examples; browse src/main/java and the BookEnhanced class.
Explore defining and calling Python methods with def, parameters, defaults, and returns, and learn naming conventions, indentation, and simple examples like printing hello world and multiplication tables.
Learn how Python defines and calls a method outside a class, including print_hello_world_twice example, focusing on indentation, underscore naming, and avoiding static, with PEP 8 style guidance.
Define and call a Python method, pass a parameter, and loop to print Hello World multiple times using a for loop with range and proper indentation.
Learn to implement Python methods and for loops using range, to print squares of numbers up to n, squares of even numbers up to 10, and numbers in reverse.
Understand how indentation defines the for loop body in Python, with range(1, 10). See that single-statement loops are valid, and that PEP 8 warns against multiple statements on one line.
Translate a Java example into Python by building a print_multiplication_table function that uses a for loop with range and formats output with f-strings.
Explore how Python handles function overloading limitations by using default parameters to print a multiplication table with print_multiplication_table, setting start, end, and table defaults.
Explore how Python returns values from methods, converting a Java style example to Python with def sum_of_two_numbers(number1, number2) and return sum, and learn that omitting a return yields None (NoneType).
Explore Python's basic data types: int, float, bool, and str, and see how integers, floats, booleans, and text are represented as objects.
Explore how Python is strongly typed yet dynamically typed, where every value is an object and types can change at runtime, with examples like int and len.
Explore Python operations: division yields a float, use integer division for integers, power with ** or pow(), note no increment operators and learn max, min, round, float() and int() conversions.
Explore boolean data types in Python, using True and False, variables, and comparison operations. Learn logical operators and, or, not, and xor, plus short-circuit behavior and basic comparisons.
Learn the Python string type (str) and its common methods, including upper, lower, capitalize, istitle, islower, isupper, isalpha, isdigit, isalnum, endswith, startswith, and find, with examples.
Explore data type conversions in Python by converting between int, float, boolean, and string, including booleans from non-empty strings, hexadecimal base 16 conversions, and error handling.
Learn why strings are immutable in Python: upper() returns a new string while the original stays unchanged, with variables merely referencing memory locations and not modifying objects.
Python uses strings for both text and single characters, with no separate character data type; index into a string and loop through its characters to print them.
Import Python's string module and explore its predefined character sets, such as ascii_letters, ascii_lowercase, ascii_uppercase, digits, hexdigits, and whitespace, then use the in operator to test membership.
Apply the string module to test vowels with the in operator, print all uppercase and lowercase letters and digits, and determine consonants using isalpha and vowel checks.
Explore Python string manipulation by splitting text into words with split and split_lines, printing each word on its own line, and mastering concatenation, repetition, and string comparison.
Explore Python conditionals with if, elif, and nested blocks, and indentation; and control loops using for and while, recognizing that Python lacks switch and do-while, with dictionaries as alternatives.
Explore a shortcut if statement in Python to simplify conditionals, using one statement to set booleans with number % 2 == 0, or produce 'yes' or 'no'.
Explore Python conditional statements with if, elif, and else, including how to take user input and convert strings to integers using int().
Solve a Python calculator exercise using two inputs and a four-option if/elif/else flow, printing the result and choices. Learn that Python uses indentation, not braces, to define blocks.
Compare Python conditionals with Java by using indentation and elif, as Python accepts any object as a condition, where non-zero values are true and zero or empty strings are false.
Review for loop syntax in Python with range, noting indentation and the exclusive end, then iterates over strings, split results, and lists, highlighting its simplicity versus Java.
Practice Python for loops by solving isPrime, sumUptoN, sumOfDivisors, and printNumberTriangle, using range(2, number) and end=' ' to print with spaces, and reinforce translating Java logic to Python.
Learn how to use the Python while loop, its colon-based syntax and proper indentation, update i, and print values, with an exercise to print squares below a limit.
Learn to simulate a do...while in Python with a while loop by repeatedly prompting for numbers, printing cubes for non‑negative inputs, and compare pre- and post‑loop approaches.
Explore object oriented programming in Python by creating Python classes from Java, building objects with instance and static data, and studying inheritance, multiple inheritance, abstract classes, polymorphism, and duck typing.
Explore how to translate a Java class into Python by creating an empty Python class named Book in a module, instantiate two objects, and print them, introducing basic object-oriented programming.
Learn how Python uses constructors to define instance data with self, distinguish class and instance variables, and implement __repr__ for readable object representations; then create and print Book instances.
Add a copies attribute to the Book class and update the representation to use a tuple. Practice creating a MotorBike class with gear and speed.
Define a MotorBike class with __init__ and __repr__ using self to store gear and speed, then instantiate honda and ducati to display their gear and speed.
Explains python constructors and instance methods, emphasizes self, shows how indentation matters, and demonstrates that Python does not support constructor overloading, using default arguments to simulate multiple constructors.
Learn how to add instance methods in Python by extending a Book class with methods to increase and decrease copies, transitioning from Java class concepts to Python practices.
explore how Python objects are dynamic under the hood, adding attributes at runtime and using __init__ constructors, versus Java's static class definitions illustrated with a Planet example.
Explore inheritance in Python through an is-a relationship, creating a Person and a Student that extends Person, using super().__init__ and __repr__ to initialize and represent data.
Explore multiple inheritance in Python by combining land and water class features into an amphibian, enabling methods like walk and swim and inheriting attributes such as walking_speed and swimming_speed.
In Python, every class by default extends the object class, and many methods come from that object, unlike Java’s capitalized Object. Learn how Python inherits core behavior.
Define an abstract class with a template method and abstract steps, using execute() with get_ready(), do_the_dishes(), and cleanup(); implement Recipe1 in Python with ABC and @abstract_method.
Explore how Python uses abstract classes to represent interfaces, then implement a gaming console API with abstract methods and concrete MarioGame and ChessGame examples.
Discover polymorphism and duck typing in Python, contrasting with Java interfaces, by looping over ChessGame and MarioGame to produce different move actions.
Explore static variables at the class level by tracking a shared Player.count, show how Python treats class variables like a static count, and warn against setting them via instance attributes.
Explore how to implement static methods in a Python class, using get_count(), and learn why static methods belong to the class rather than instances, with examples using Messi and Ronaldo.
Explore Python data structures by mastering lists—indexing, slicing, and adding elements; use lists as queues or stacks, apply list comprehension for lengths, then learn sets and dictionaries.
Create a list with square brackets, explore basic operations like max, min, sum, append, insert at index, remove, membership check, and index search, then loop through and print elements.
Explore Python lists of strings with practical puzzles, learning indexing, append vs extend, remove vs del, and how list operations handle multiple types.
Master Python's list slicing to retrieve subsets, delete, and replace values using start, end, and step indices, including reverse slicing and practical examples from 'Zero' to 'Nine'.
Explore in-place list operations and non-mutating alternatives in Python, including reverse, reversed, sort, and sorted. Learn to use key and reverse options, and understand how sort differs from sorted.
learn how a Python list can act as a stack or a queue using append to add and pop to remove, illustrating last-in, first-out and first-in, first-out.
Learn how to manage a list of custom Country objects in Python, defining a Country class with __init__ and __repr__ to print representations, and using indexing, slicing, and appending.
Learn how to sort a list of Country objects in Python using a key, and find the max and min by population or area, using attrgetter.
Discover list comprehension in Python by filtering and transforming lists, from selecting four-letter numbers to extracting even values with concise one-liners.
Explore sets in Python by comparing them to lists, showing how sets eliminate duplicates, support add and remove, membership tests, and operations like union, intersection, and difference.
Explore how dictionaries store key-value pairs with the dict class, create and update entries, compare them to a hash map, and safely retrieve with get and defaults.
Master list, set, and dictionary comprehension to build squares of the first ten numbers, and distinguish empty and nonempty structures using brackets and braces.
Discover Python tuples as immutable sequences that return multiple values, support destructuring and indexing, and swap variables; compare them with lists and learn single-element tuple creation.
Explore Python exception handling with try-catch blocks, understand the exception hierarchy, compare runtime and other exceptions, and learn to throw and create custom exceptions; no checked exceptions in Python.
Explore common Python exceptions, including ZeroDivisionError, TypeError, NameError, and AttributeError, and learn how these errors arise and how they fit into Python's exception hierarchy.
Learn how to handle errors in Python using try-except-else-finally, catch ZeroDivisionError and other exceptions, and use else and finally blocks to control program flow.
Create and raise a custom Python exception to handle currency mismatches, by defining a subclass of Exception (e.g., currencies do not match error) and including a helpful error message.
Explore how Python treats functions as first-class citizens, enabling passing as arguments and storage as objects, with map, filter, and reduce, and avoiding mutable state.
Explore anonymous functions with lambda in Python, replacing separate function definitions. Learn to pass these lambdas to other methods and apply functional ideas like filter and map.
Apply filter with a lambda to select odd numbers from a list, then extend to strings ending with 'at', length 3, or starting with 'A'.
Apply mapping with the map function to transform lists in Python using lambda expressions. See how to uppercase words and square numbers, maintaining one output item per input item.
Explore how reduce reduces a list to a single result using a lambda, applying operations such as sum, max, and min with functional programming concepts like map and filter.
Combine map, filter, and reduce to process numbers: filter even values, map to squares, and sum results, illustrating the power of functional programming in Python.
Practice combining map and reduce to sum the days from a list of month tuples and identify the month with the fewest days using lambdas.
learn how to import predefined Python modules like math, call floor and gcd, and view help for functions and module documentation, including selective imports to avoid namespace conflicts.
Learn to perform accurate calculations with the Decimal class instead of float for accuracy, and explore the math module for pi, e, and functions: ceiling, factorial, and greatest common denominator.
Explore the Python statistics module by calculating mean, median, median high, median low, and variance on a simple marks list.
Explore the deque from collections for queue and stack operations, showing its efficiency over lists and how to insert or remove from both ends with append and pop left.
Learn to use Python's datetime module to handle dates and times, access today's date, create specific dates, and add days, weeks, or hours via time delta that returns new values.
Use enumerate to access both index and element in a Python loop, then print a formatted string showing the index and its value.
Learn how to create enums in Python by importing Enum, defining a Currency class that extends Enum with USD, EUR, and INR; access them as Currency.USD and Currency(1).
Learn how to define and call Python methods with mandatory, default, variable (*args), and keyword (**kwargs) parameters, and practice named parameter calls.
Understand how mandatory_parameter, default_parameter, *args, and keyword arguments shape Python function calls, using named parameters to pass values and reading types as tuple and dictionary.
learn how to pass values to Python methods using unpacking for lists and dictionaries, converting list elements into positional arguments and dictionary items into keyword arguments.
Explore the PEP 8 style guide for Python, covering naming conventions, layout, and inline comments. Learn to apply guidelines thoughtfully by prioritizing why over what in code decisions.
Explore the Zen of Python (PEP 20) and embrace readability, explicitness, and simplicity in your code. Remember flat structures, never hide errors, and keep implementations easy to explain.
Learn how to create Python modules with multiple classes and methods, import one module into another, and guard executable code with if __name__ == '__main__' to avoid auto execution.
Learn how None signals absence of value in Python, including NoneType, defaulting parameters to None, and using None to indicate missing data or dictionary get returns None for absent keys.
Learn how __repr__ and __str__ control printing of objects, with __repr__ for unambiguous representations and __str__ for human-readable output, and when to implement each.
Explore how to emulate a switch in Python using a dictionary. Map day numbers to names with week_days and provide a default for invalid days.
Master generating random values in Python with the random module: use random(), randint, choice, and sample to pick from lists or strings, including odd numbers and multiples.
Learn returning multiple values from a Python function using tuples, avoiding extra classes. Access results via tuple indices and decide when a one-off tuple is preferable to a class.
Explore implementing simple data classes in Python with namedtuple from the collections module, creating point objects with x and y and 3D points with x, y, z and attribute access.
Discover why Python avoids private variables and getters and setters, embracing direct attribute access and encapsulation via the constructor, while allowing later validation without changing client code.
Discover how Python uses property decorators to create getters and setters that add validations without altering client code, using _copies and @property and @copies.setter.
Discover operator overloading in python by implementing __add__ and __sub__ for a Money class. Add or subtract currency amounts and print results like EUR 30 using a custom __repr__.
Discover operator overloading in Python by implementing dunder methods such as __add__, __sub__, __mul__, and __pow__, returning new objects to create simple, readable expressions.
learn how to implement object equality in Python by defining __eq__ and comparing money attributes as tuples (currency, amount), and understand how tuple comparison affects equality and ordering.
Explore how to implement object comparisons using __gt__, __lt__, __le__, and __ge__ to compare amounts. Understand how currencies affect results and how to ignore currencies when comparing only the amounts.
Use total ordering in Python by implementing __eq__ and one of __gt__, __lt__, __le__, or __ge__, letting the decorator derive the rest while noting a performance trade-off.
Congratulations on completing the Java to Python course, covering variables, methods, classes, inheritance, interfaces, abstract classes, exception handling, and data structures, and learning how to write good Python code.
Python is one of the most popular programming languages for beginners. Python offers both object-oriented and structural programming features. Learning Python can be an awesome experience.
Learning Python will open up great options as a Programmer because Python is one of the most requested skills in 2020!
So, do you want to be a kickass Python programmer without a lot of effort? Do you have a little bit of Java Programming Experience?
Why not use your Java Programming Experience and learn Python Step by Step at F1 Speed?
I’m Ranga Karanam, the founder of in28minutes and Your Instructor for this awesome course. I’ve designed this Python Programming Masterclass just for you!
This Beginner Python Programming Course takes an hands-on Step By Step Approach using more that 100 Code Examples. We use a combination of Python Shell and PyCharm as an IDE to illustrate more than 100 Python Coding Exercises, Puzzles and Code Examples. We convert a number of Java Examples to Python.
WHAT OUR LEARNERS ARE SAYING:
5 STARS - The tutorial remains focused on what was promised in its title. The flow is quiet good and answers (almost) all the thought questions as and when it comes to mind. I feel transition to the lovely python syntax and capabilities, but difficult to start with for a java programmer, have been quiet nicely done in this tutorial. "Java programmers go for it."
5 STARS - Detailed explanation with good hands-on. Best course for those who know Java and new to python, and want to learn by comparison.
5 STARS - Very informative course . The instructor does a great job explaining the details. I feel confident that I create Python programs with accepted standard patterns and style now.
5 STARS - Amazing course - very helpful in transitioning to Python from a Java mindset
5 STARS - A java developer can quickly go through all the videos without practicing any example[But recommended to do exercises if you have time and not really eager to know python]. Once you complete all the videos, you can come back and start referring/practicing as per your need."
5 STARS - I think it was clearly laid out and well done. Lots of good ideas from an experienced software developer. Will look for more classes. Thank you.
5 STARS - “Great Course"
5 STARS - "I'm glad I took this course because a lot of projects that I'm working on now contain Python code as part of the project, and I want to understand what the code is doing. The instructor is easy well-organized and easy to follow."
5 STARS - "In acquiring a new skill when you know an existing one, learning by comparison is the best way. Putting out Java and Python code side-by-side is like a short-circuit, but without the shocks!"
In about 100 Steps, we explore the most important Python Programming Language Features that every Beginner Python Programmer should know:
Basics of Python Programming - Expressions, Variables and Printing Output
Python Conditionals and If Statement
Methods - Parameters, Arguments and Return Values
Object Oriented Programming - Class, Object, State and Behavior
Basics of OOPS - Encapsulation, Inheritance and Abstract Class.
Basics about Python Data Types
Basics about Python Built in Modules
Conditionals with Python - If Else Statement, Nested If Else
Loops - For Loop, While Loop in Python, Break and Continue
Immutablity of Python Basic Types
Python Data Structures - List, Set, Dictionary and Tuples
Basics of Designing a Class - Class, Object, State and Behavior. Deciding State and Constructors.
Introduction to Exception Handling - try, except, else and finally. Exception Hierarchy. Throwing an Exception. Creating and Throwing a Custom Exception.
Here are the complete step by step details of the Java to Python Course:
Getting Started With Python
Step 01 - Hello World in Python
Step 02 - Hello World in Python - Making Sense
Step 03 00 - Importing-Java-Code-into-Eclipse
Step 03 01 - Your First Python Method
Step 04 - Your First Python Method - A Few Tips
Step 05 - Passing Parameters and Your First Python Loop
Step 06 - Exercises with Python Methods and For Loop
Step 07 - Python For Loop - Puzzles
Step 08 - Writing Java Example in Python - Part 1
Step 09 - Writing Java Example in Python - Part 2
Step 10 - Returning values from methods
Step 11 - Introduction to Basic Data Types in Python
Step 12 - Python is Strongly Typed and Dynamic Language
Step 13 - Numberic Operators and Functions in Python
Step 14 - Boolean Operators in Python
Step 15 - Python Text Data Type - String
Step 16 - Data Type Conversion - Puzzles
Step 17 - Strings are immutable
Step 18 - There is no seperate Character data type
Step 19 - String module
Step 20 - Exercise - is_vowel, print lower case and upper case characters
Step 21 - String - Exercises and Puzzles
Conditionals and Loops
Step 22 - Overview of Conditionals and Loops in Python
Step 23 - Shortcut If Statement
Step 24 - If Else and Elif in Python
Step 25 - If Elif Exercise - Java to Python
Step 26 - Conditionals - Java vs Python
Step 27 - For Loop - A Review
Step 28 - For Loop - A few examples
Step 29 - While Loop in Python - Introduction and Exercise
Step 30 - Implementing Do While with While
Object Oriented Programming with Python
Step 31 - OOPS in Python - An overview
Step 32 - Your First Python Class - Empty Class and Instances
Step 33 - Instance Variables and Constructors in Python
Step 34 - Exercise - Part 1 - Add an attribute
Step 35 - Exercise - Part 2 - Create a new Class
Step 36 - Constructors in Python - A few tips
Step 37 - Adding instance methods
Step 38 - OOPS Under the Hood
Step 39 - Inheritance in Python
Step 40 - Multiple Inheritance in Python
Step 41 - Every class extends object
Step 42 - Creating an Abstract Class
Step 43 - Representing an Interface using Abstract Class
Step 44 - Polymorphism and Duck Typing
Step 45 - Static Variables at Class Level
Step 46 - Static Methods in Python
Python Data Structures
Step 47 01 - Introduction to Data Structures in Python
Step 47 02 - Operations on List Data Structure
Step 48 - Puzzles with Strings Lists
Step 49 - List Slicing
Step 50 - List Sorting, Looping and Reversing
Step 51 - List as a Stack and Queue
Step 52 - List with a custom class - Country and representation TODO EDIT
Step 53 - List with a custom class - Part 2 - sorting, max and min
Step 54 - List Comprehension
Step 55 - Introduction to Set
Step 56 - Introduction to Dictionary
Step 57 - Puzzles with Data Structures
Step 58 - Tuples
Exception Handling in Python
Step 59 - Part 1 - Overview of Exception Handling
Step 59 - Part 2 - Exceptions in Python
Step 60 - Exception Handling with try except else finally block
Step 61 - Throwing Custom Exceptions in Python
Functional Programming
Step 62 - Functions are First Class Citizens in Python
Step 63 - Introduction to Lambdas
Step 64 - Filtering a list using filter method
Step 65 - Mapping a List with map method
Step 66 - Reduce a List to one result value
Step 67 - Combining map, filter and reduce - Example 1
Step 68 - Combining map, filter and reduce - Example 2
Python Tips
Step 69 - Tip 1 - Using Predefined Python Modules
Step 70 - Tip 2 - Math Module and Decimal Class
Step 71 - Tip 3 - Statistics Module - find mean and median
Step 72 - Tip 4 - Collections Module - deque for Queue and Stack
Step 73 - Tip 5 - Date Module
Step 74 - Tip 1 - Loop - Getting Index Element
Step 75 - Tip 2 - Enum in Python
Step 76 - Tip 3 - Methods and Arguments - Basics
Step 77 - Tip 4 - Methods and Arguments - Keyword Arguments
Step 78 - Tip 5 - Methods and Arguments - Unpacking Lists and Dictionaries
Step 79 - Tip 6 - PEP8 - Python Style Guide
Step 80 - Tip 7 - PEP20 - Zen of Python
Step 81 - Tip 8 - Creating Custom Modules and Using Them
Step 82 - Tip 9 - None
Step 83 - Tip 10 - repr vs str
Step 84 - Tip 11 - No Switch in Python
Step 85 - Tip 12 - Generating Random Values in Python
Step 86 - Tip-13 Returning Multiple Values using Tuples v02
Step 87 - Tip 14 - Implementing Data Classes with namedtuple
Step 88 - Tip 15 - Getters and Setters is Python Anti Pattern
Step 89 - Tip 16 - Implementing Property Decorators
Step 90 - Tip 17 - Operator Overloading - Adding and Subtracting amounts
Step 91 - Tip 18 - Operator Overloading - Other Operators
Step 92 - Tip 19 - Comparing equality of objects
Step 93 - Tip 20 - Using greater than and less than to compare objects
Step 94 - Tip 21 - Total Ordering - Simplifying object comparison