Calculate Bitwise Xor In Python Code Example


Example: write a program to input a number and display its double and half values using shift operator in python

# Write a program to input a number and display its Double and Half values using SHIFT operator  print("Hi \nThis is a basic calculator \nwhich doubles or divides into half the value entered in it") a = int(input("pls enter your number:\n")) b = a << 1 c = a >> 1 print("number:", a, "\ndouble:", b, "\nhalf:", c)

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable