Skip to content

Commit cb12bcf

Browse files
committed
Python Task
0 parents  commit cb12bcf

10 files changed

+69
-0
lines changed

Diff for: 1.variable assignment.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Python 3.12.4 (tags/v3.12.4:8e8a4ba, Jun 6 2024, 19:30:16) [MSC v.1940 64 bit (AMD64)] on win32
2+
Type "help", "copyright", "credits" or "license()" for more information.
3+
>>> x="Ahmad Saad Aldeen"
4+
>>> y=25
5+
>>> print (x,y)
6+
Ahmad Saad Aldeen 25

Diff for: 10.variable naming.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Python 3.12.4 (tags/v3.12.4:8e8a4ba, Jun 6 2024, 19:30:16) [MSC v.1940 64 bit (AMD64)] on win32
2+
Type "help", "copyright", "credits" or "license()" for more information.
3+
>>> height_in_meters = 100
4+
>>> weight_in_kilograms = 50
5+
>>> BMI = weight_in_kilograms /height_in_meters ** 2
6+
>>> print (BMI)
7+
0.005

Diff for: 2.Simple arithmetic.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Python 3.12.4 (tags/v3.12.4:8e8a4ba, Jun 6 2024, 19:30:16) [MSC v.1940 64 bit (AMD64)] on win32
2+
Type "help", "copyright", "credits" or "license()" for more information.
3+
>>> x=5
4+
>>> y=10
5+
>>> print (x+y)
6+
15
7+
>>> print (x*y)
8+
50
9+
>>> print (x-y)
10+
-5
11+
>>> print (x/y)
12+
0.5

Diff for: 3.string concatenation.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Python 3.12.4 (tags/v3.12.4:8e8a4ba, Jun 6 2024, 19:30:16) [MSC v.1940 64 bit (AMD64)] on win32
2+
Type "help", "copyright", "credits" or "license()" for more information.
3+
>>> First_name="Ahmad"
4+
>>> Last_name="Saad Aldeen"
5+
>>> print (First_name,Last_name)
6+
Ahmad Saad Aldeen

Diff for: 4.updating variables.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Python 3.12.4 (tags/v3.12.4:8e8a4ba, Jun 6 2024, 19:30:16) [MSC v.1940 64 bit (AMD64)] on win32
2+
Type "help", "copyright", "credits" or "license()" for more information.
3+
>>> x=7
4+
>>> print (x+1)
5+
8

Diff for: 5.swapping variables.py

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Python 3.12.4 (tags/v3.12.4:8e8a4ba, Jun 6 2024, 19:30:16) [MSC v.1940 64 bit (AMD64)] on win32
2+
Type "help", "copyright", "credits" or "license()" for more information.
3+
>>> x=5
4+
>>> y=10
5+
>>> temp=x
6+
>>> x=y
7+
>>> y=temp
8+
>>> print (x,y)
9+
10 5

Diff for: 6.using constants.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Python 3.12.4 (tags/v3.12.4:8e8a4ba, Jun 6 2024, 19:30:16) [MSC v.1940 64 bit (AMD64)] on win32
2+
Type "help", "copyright", "credits" or "license()" for more information.
3+
>>> pi=3.14159
4+
>>> radius=5
5+
>>> circumerence=2*pi*radius
6+
>>> print (circumerence)
7+
31.4159

Diff for: 7.Boolean variables.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Python 3.12.4 (tags/v3.12.4:8e8a4ba, Jun 6 2024, 19:30:16) [MSC v.1940 64 bit (AMD64)] on win32
2+
Type "help", "copyright", "credits" or "license()" for more information.
3+
>>> is_sunny=1
4+
>>> is_raining=0
5+
>>> print (is_sunny,is_raining)
6+
1 0

Diff for: 8.tyoe conversion.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Python 3.12.4 (tags/v3.12.4:8e8a4ba, Jun 6 2024, 19:30:16) [MSC v.1940 64 bit (AMD64)] on win32
2+
Type "help", "copyright", "credits" or "license()" for more information.
3+
>>> num=10
4+
>>> num_str="10"
5+
>>> print (num,num_str)
6+
10 10

Diff for: 9.length of a string.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Python 3.12.4 (tags/v3.12.4:8e8a4ba, Jun 6 2024, 19:30:16) [MSC v.1940 64 bit (AMD64)] on win32
2+
Type "help", "copyright", "credits" or "license()" for more information.
3+
>>> sentence="Ahmad"
4+
>>> print (len(sentence))
5+
5

0 commit comments

Comments
 (0)