-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic.py
More file actions
83 lines (51 loc) · 2.1 KB
/
Copy pathbasic.py
File metadata and controls
83 lines (51 loc) · 2.1 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
# print("hello my name is Abhijit and\nI am learning Python programming.")
# x=5
# y=2
# print("The Value of x is:", x)
# print("The Value of y is:", y)
# z= x + y
# print("The Value of z is:", z)
# print((z)*7)
# #or
# #print("x + y =", x + y)
# # both can be used to print the value of z. The
# # first method is to store the value in a variable and then print it,
# # while the second method is to directly print the result of the addition operation.
# # subtraction operation
# print("the subtraction of x and y is:", x - y)
# print("the subtraction of", x, "and", y, "is:", x - y)
# # multiplication operation
# print("the multiplication of x and y is:", x * y)
# # division operation
# print("the division of x and y is:", x / y)
# # modulus operation
# print("the modulus of x and y is:", x % y)
# # exponentiation operation
# print("the exponentiation of x and y is:", x ** y)
# # floor division operation
# print("the floor division of x and y is:", x // y)
# emp_id = input("Enter your employee id: ")
# emp_name = input("Enter your employee name: ")
# print('welcome', emp_id, emp_name)
# x=int(input("x: ")) #int will convert the input string into integer
# y=float(input("y: ")) #float will convert the input string into float (decimal) number
# print("The Value of x is:", x)
# print("The Value of y is:", y)
# #addition operation
# print("the addition of x and y is:", x + y)
# # subtraction operation
# print("the subtraction of x and y is:", x - y)
# print("the subtraction of", x, "and", y, "is:", x - y)
# # multiplication operation
# print("the multiplication of x and y is:", x * y)
# # division operation
# print("the division of x and y is:", x / y)
# # modulus operation
# print("the modulus of x and y is:", x % y)
# # exponentiation operation
# print("the exponentiation of x and y is:", x ** y)
# # floor division operation
# print("the floor division of x and y is:", x // y)
# print("data type of x is:", type(x))
# print("data type of y is:", type(y))
# print(f"the addition of {x} and {y} is: {x + y}") # f is used to format the string and print the value of x and y in the string.