Tag: Python

  • 412. Fizz Buzz Python 3 Solution

    412. Fizz Buzz Python 3 Solution

    412. Fizz Buzz Python 3 Solution for LeetCode and HackerRank problems Requirements Input: integer n Output: string array answer (1-indexed) where: answer[i] == “FizzBuzz” when i is divisible by both 3 and 5. answer[i] == “Fizz” when i is divisible by 3. answer[i] == “Buzz” when i is divisible by 5. answer[i] == i for […]

  • Automate Mouse Clicks on PC record and playback

    Automate Mouse Clicks on PC record and playback

    Automate Mouse Clicks on PC record and playback mouse actions. Automate mouse clicks using Python in Windows 10 and this simple script. Python is an increasingly popular programming language for quick tasks like this one. My Python programs are made of 2 parts. one that records mouse click events, that’s all that it does. The […]

  • How to learn Python as a second language

    How to learn Python as a second language

    How to learn Python as a second language. After watching and reading few tutorials you still can’t say that you know much Python and that’s probably true. How I try to learn it, still work in progress, is to use a project-based approach. Learn the basics of the language. 1. No semicolons; 2. Indentation matters […]

  • How to reverse a string in Python 3

    How to reverse a string in Python 3

    To reverse a string in Python the bellow are the best ways so far: Write [::-1] to do slicing in Python starting at first character, until last, step by 1 in reverse (-1). It’s a pretty nice way to impress your imaginary friends. Option 1 Option 2 Whole code demo Write a comment or no, […]

  • How to reverse integer in Python 3

    How to reverse an integer in Python 3. In Python 3 int type is the same as long so there is no need to check for int overflow. In other cases you will have to check for integer max value and min value to avoid a stack overflow. The steps are bellow with each testing […]