-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
49 lines (46 loc) · 1.16 KB
/
main.py
File metadata and controls
49 lines (46 loc) · 1.16 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
from os import setns
from resource import struct_rusage
from unittest import removeResult
# age = 19
# name = (input("Her "))
# print(name + "string")
# print(name.upper())
# print(name.lower())
# print(name.find("a"))
# print(name.replace("z", "zz"))
# print(f"Name: {name}")
# str_template = "User information: {0} - {1}"
# print(str_template.format(name, age))
# lst = [1,2,3];
# # print(lst[-1]);
# # list.append();
# # list.remove();
# list_console = input("Enter list without spaces: ")
# numbers = list_console.split(" ")
# # print(print(numbers))
# # tup = (1,2,3)
# # print(tup)
# # print(tup[0])
# first, second, third = tup
# eng_rus_duct = {"cat" : "кот", }
# set_from_list = set(lst)
# set_example = {1, 2, 3}
# print(set_example)
def calc():
num1 = float(input())
num2 = float(input())
operate = input()
if operate == "+":
ans = num1 + num2
elif operate == "-":
ans = num1 - num2
elif operate == "*":
ans = num1 * num2
elif operate == "/":
if(num2 != 0):
ans = num1 / num2
else:
ans = "Zero division!"
else:
ans = "Unknown operation!"
print(f"Result: {ans}")