Posts

E114 indentation is not a multiple of four (error) in python

An indentation error in Python occurs when the code is not properly aligned according to Python's indentation rules. Python uses indentation to define the structure of the code, such as blocks within loops, functions, conditionals, etc. Here are common causes and how to fix them: Common Causes of Indentation Errors: Inconsistent Indentation : Mixing tabs and spaces. Incorrect Block Indentation : Indenting the code block incorrectly relative to its control structure (e.g., a loop or function). Unintentional Indentation : Accidentally adding extra spaces or tabs. (E114) Th is error is raised when comment line has indentation which is not multiple of four. Example 1: def say_hello(): plainText = "hello!" # TxtText:markdown = "hello!" (this is wrong, it uses 5 spaces before comment) # TxtText:markdown = "hello!" (this is right, it uses 4 spaces before comment) Example 2: (Incorrect) def example_function(): print("This will cau...

Logic Gates

Image
  Logic Gates Logic gate is an electronic circuit having one or more inputs and only one output. These are the basic building blocks of a digital system. The input is related to the output based on a certain logic. The Basic logic gates are given below -  1. AND gate - For this logic gate output is "1" only when both input is "1", else "0". Output  = A . B 2. OR gate - For this logic gate output is "1", when any one of the input is "1", else "0". Output  = A+B 3. NOT gate - For this logic gate output is "1" when input is "0" and vice-versa. Output =  A̅ Derived logic gates are :-  1. NAND gate - Logic is working as NOT(AND). Output =  A . B 2. NOR gate - Logic is working as NOT(OR). Output = ( A+B ) 3. XOR gate - Output is "1" for different inputs and "0" for similar inputs. Output = (A. B̅  +  A̅.B) 4. XNOR gate - Logic is working as NOT(XOR). Output = ( A . B +  A̅ . B̅)

Basics of Computer System

Image
A Computer System is an integrated electronic device. It Consists of following main components :- 1. Central Processing Unit (Brain of the computer) Arithmetic & Logic Unit Control Unit  Memory Unit 2. Input Devices (Keyboard, Mouse etc.) 3. Output Devices (Monitor, Speaker, Printer etc.) These components are working together to give a desired output to the user in return of an input. User gives an input to the computer system using any input device like keyboard, mouse etc. in form of user friendly code. This information is transfer to the Central Processing Unit and then converted into binary format in 0's and 1's (known as the machine code).  The Central Processing Unit processes the input data, understands the requirement by user and performs the desired operation.  Then CPU transfers the output to the Output Device. The output is provide to the user in user friendly form by the output device e.g. on the monitor, speaker etc.           ...