0% found this document useful (0 votes)
3 views2 pages

Python Input and Operators Notes

This document provides notes on Python programming, focusing on user input methods and types, including string, integer, and float inputs. It also outlines various types of operators in Python, such as arithmetic, relational, assignment, logical, membership, identity, and bitwise operators. Additionally, it includes a reference for the XOR bitwise operation with its truth table.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Python Input and Operators Notes

This document provides notes on Python programming, focusing on user input methods and types, including string, integer, and float inputs. It also outlines various types of operators in Python, such as arithmetic, relational, assignment, logical, membership, identity, and bitwise operators. Additionally, it includes a reference for the XOR bitwise operation with its truth table.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Python Programming Notes - Part 2

Input in Python
input() statement is used to accept values (using keyboard) from user

• string input (words / sentences)

name = input("name : ")

Output / Execution Visual:

name : Shradha
Memory Box: name -> ["Shradha"]

• int input

age = int(input("age : "))

Output / Execution Visual:

age : 23
Memory Box: age -> [23]

• float input

price = float(input("price : "))

Output / Execution Visual:

price : 23.5

Types of Operators
• Arithmetic Operators ( + , - , * , / , // , % , ** )

• Relational / Comparison Operators ( == , != , > , < , >= , <= )

• Assignment Operators ( = , -= , *= , /= , %= , //= , **= )

• Logical Operators ( not , and , or )

• Membership Operators ( in , not in )

• Identity Operators ( is , is not )


• Bitwise Operators ( & , | , ^ ) [AND, OR, XOR]

Bitwise / XOR (^) Logic Reference


XOR (^) Mathematical Truth Table Note:
1 ^ 1 -> R = 0
0 ^ 0 -> R = 0
1 ^ 0 -> R = 1
0 ^ 1 -> R = 1

You might also like