Assignment 1
Assignment 1
calculator
# add two numbers
"1. Add\n" \
"2. Subtract\n" \
"3. Multiply\n" \
"4. Divide\n")
if select == 1:
add(number_1, number_2))
elif select == 2:
subtract(number_1, number_2))
elif select == 3:
multiply(number_1, number_2))
elif select == 4:
divide(number_1, number_2))
else:
print("Invalid input")
1. Add
2. Subtract
3. Multiply
4. Divide
OUTPUT
Write a program that takes users first name
last name and age and print them after
concatenation
firstname = input("enter your First Name : ")
print (str_a)
OUTPUT
Write a program to print all bitwise operators
# bitwise operators
a = 10
b=4
print("a | b =", a | b)
print("a ^ b =", a ^ b)
OUTPUT
Write a program in python using all logical
operators
# Python program to demonstrate
a = 10
b = 12
c=0
else:
# logical or operator
if a > 0 or b > 0:
print("Either of the number is greater than 0")
else:
if b > 0 or c > 0:
else:
if not a:
else: