-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchapter_02.py
More file actions
102 lines (68 loc) · 1.58 KB
/
chapter_02.py
File metadata and controls
102 lines (68 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# marks = 30
# print(marks)
# name = "Ali"
# print(name)
# x1 = 3
# age = 80
# Age = 23
# comment shortcut = ctrl + /
# print = 34
# print(print)
# =======> datatypes < ===============
# a = 5
# b = 24.500003452
# c = 'Hello World 23423, @ # '
# d = '5'
# e = True
# ========= > type casting < ===========
# x = '123.567'
# print(type(x))
# print(x)
# y = float(x)
# print(type(y))
# print(y)
# marks = 45
# print("Student Marks = ", marks)
#=========> input < ===========
# name = input("What is your Name ?")
# print("your name is : ", name)
# ========= > Operators < ============
# 1 : arithmeic operater
# a = 10
# b = 20
# print("Addition : ", a + b )
# print("Subtraction : ", a - b )
# print("multiplication : ", a * b )
# print("divsion : ", b / a )
# print("floor Division : ", b // a )
# print("Reminder : ", b % a )
# print("Power : ", a ** b )
# ======== > comparison Operator < ========
# x = 11
# print( x == 10 )
# print( x > 10 )
# print( x < 10 )
# print( x >= 10 )
# print( x <= 10 )
# print( x != 10 )
# ======== > logical operator < ==========
# a = 10
# b = 15
# print( a == 10 and b == 15)
# print( a == 12 or b == 15)
# print(not a == 10)
# ======== > string operations < =======
# x = "PYTHON"
# print(len(x))
# print(x.upper())
# print(x.lower())
# print(x[0])
# print(x[-1])
# ===== > String Concantenation < =========
# first_name = "Ishfaq"
# last_name = "Khan"
# print(first_name + " " + last_name)
# ======= > String Formating <=======
# first_name = "Ishfaq"
# last_name = "Khan"
# print(f"My first name is {first_name} and my last name is {last_name}")