0% found this document useful (0 votes)
1 views

python output (1)

The document outlines various programming assignments and their outputs, including checks for Armstrong numbers, factorial calculations, palindrome verification, and logical, bitwise, membership, and identity operations. It also includes examples of arithmetic operations and variable types in Python. The document concludes with a mention of variable scope, highlighting global and local variables.

Uploaded by

aaliyab758
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

python output (1)

The document outlines various programming assignments and their outputs, including checks for Armstrong numbers, factorial calculations, palindrome verification, and logical, bitwise, membership, and identity operations. It also includes examples of arithmetic operations and variable types in Python. The document concludes with a mention of variable scope, highlighting global and local variables.

Uploaded by

aaliyab758
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

OUTPUT OF ASSIGNMENT: 9

Enter the Number: 153 OUTPUT OF ASSIGNMENT: 10


153 is an Armstrong number Enter a number: 5
The factorial of 5 is: 120
OUTPUT OF ASSIGNMENT: 8
Enter the Value to check: OUTPUT OF ASSIGNMENT: 5
NAMAN Enter a number: 10
The string is a palindrome. Positive number
Thank You
OUTPUT OF ASSIGNMENT: 6
Enter a number :10
Positive number OUTPUT OF ASSIGNMENT: 7
Thank you Total number of element in Series5
12358
OUTPUT OF ASSIGNMENT: 4 Succesfully Printed
logical Operators given below
a > 5 and a < 7 => False OUTPUT OF ASSIGNMENT: 3
a > 5 or a < 7 => True
not (a > 5 and a < 7) => True For a = 46 and b = 4
Calculate the following:
Bitwise Operators given below - 1. Addition of two numbers: a + b = 50
a&b:0 2. Subtraction of two numbers: a - b = 42
a | b : 15
a ^ b : 15
3. Multiplication of two numbers: a * b = 184
~a : -8 4. Division of two numbers: a / b = 11.5
a << b : 1792 5. Floor division of two numbers: a // b = 11
a >> b : 0 6. Reminder of two numbers: a mod b = 2
7. Exponent of two numbers: a ^ b = 4477456
Membership Operators given below -
x = 31 is present in the given list. False
x = 31 is not present in the given list. True For a = 46 and b = 4
Check the following:
Identity Operators given below - 1. Two numbers are equal or not: False
a is c => True
a is not c => False 2. Two numbers are not equal or not: True
a is b => False 3. a is less than or equal to b: False
a is not b => True 4. a is greater than or equal to b: True
5. a is greater b: True
OUTPUT OF ASSIGNMENT: 2 6. a is less than b: False
<class 'str'>
<class 'int'>
a += b: 50
<class 'float'>
a -= b: 42
<class 'complex'>
<class 'bool'> a *= b: 184
<class 'set'> a /= b: 11.5
<class 'dict'> a %= b: 2
<class 'list'> a **= b: 4477456
<class 'tuple'> a //= b: 11

Modified globally gloVar


I am local variable
Modified globally gloVar

You might also like