diff --git a/.idea/material_theme_project_new.xml b/.idea/material_theme_project_new.xml new file mode 100644 index 0000000..5c574b4 --- /dev/null +++ b/.idea/material_theme_project_new.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/Hometask 2.py b/Hometask 2.py new file mode 100644 index 0000000..1f860c3 --- /dev/null +++ b/Hometask 2.py @@ -0,0 +1,77 @@ +my_string = "Hello, World!" +my_integer = 42 +my_float = 3.14 +my_bool = True +my_list = [1, 2, 3, 4, 5] +my_dict = {"key1": "value1", "key2": "value2"} +my_tuple = (1, 2, 3) +my_none = None + +num1 = 10 +num2 = 20 +print(num1 < num2) + +str1 = "apple" +str2 = "banana" +print(str1 == str2) + +bool1 = True +bool2 = False +print(bool1 and bool2) + +list1 = [1, 2, 3] +list2 = [1, 2, 3] +print(list1 == list2) + +dict1 = {"key1": "value1", "key2": "value2"} +dict2 = {"key1": "value1", "key2": "value2"} +print(dict1 == dict2) + +tuple1 = (1, 2, 3) +tuple2 = (1, 2, 3) +print(tuple1 == tuple2) + +num_str = 125 +num_str = str(num_str) + +message = "Hi, my name is Python!" +message = message.replace('y', '0').replace('i', '1') + +split_test = "This is a split test" +split_list = split_test.split(' ') +string_join = ' '.join(split_list) + +length_of_string_join = len(string_join) + +print(num_str) +print(message) +print(string_join) +print(length_of_string_join) + +list_append = [1, 2, 3] +list_append.append(4) +list_append.append(5) + +list_extend = [4, 5, 6] +list_extend.extend([7, 8, 9]) + +index_of_6 = list_extend.index(6) + +length_of_list_append = len(list_append) + +print(list_append) +print(list_extend) +print(index_of_6) +print(length_of_list_append) + +dict_test = {'car': 'Toyota', 'price': 4900, 'where': 'EU'} +print(dict_test['car']) +print(dict_test['where']) + +keys = dict_test.keys() +values = dict_test.values() +print(keys) +print(values) + +items = dict_test.items() +print(items) \ No newline at end of file diff --git a/main.py b/main.py index 1dc45ac..1f860c3 100644 --- a/main.py +++ b/main.py @@ -1 +1,77 @@ -print("Hello World!") \ No newline at end of file +my_string = "Hello, World!" +my_integer = 42 +my_float = 3.14 +my_bool = True +my_list = [1, 2, 3, 4, 5] +my_dict = {"key1": "value1", "key2": "value2"} +my_tuple = (1, 2, 3) +my_none = None + +num1 = 10 +num2 = 20 +print(num1 < num2) + +str1 = "apple" +str2 = "banana" +print(str1 == str2) + +bool1 = True +bool2 = False +print(bool1 and bool2) + +list1 = [1, 2, 3] +list2 = [1, 2, 3] +print(list1 == list2) + +dict1 = {"key1": "value1", "key2": "value2"} +dict2 = {"key1": "value1", "key2": "value2"} +print(dict1 == dict2) + +tuple1 = (1, 2, 3) +tuple2 = (1, 2, 3) +print(tuple1 == tuple2) + +num_str = 125 +num_str = str(num_str) + +message = "Hi, my name is Python!" +message = message.replace('y', '0').replace('i', '1') + +split_test = "This is a split test" +split_list = split_test.split(' ') +string_join = ' '.join(split_list) + +length_of_string_join = len(string_join) + +print(num_str) +print(message) +print(string_join) +print(length_of_string_join) + +list_append = [1, 2, 3] +list_append.append(4) +list_append.append(5) + +list_extend = [4, 5, 6] +list_extend.extend([7, 8, 9]) + +index_of_6 = list_extend.index(6) + +length_of_list_append = len(list_append) + +print(list_append) +print(list_extend) +print(index_of_6) +print(length_of_list_append) + +dict_test = {'car': 'Toyota', 'price': 4900, 'where': 'EU'} +print(dict_test['car']) +print(dict_test['where']) + +keys = dict_test.keys() +values = dict_test.values() +print(keys) +print(values) + +items = dict_test.items() +print(items) \ No newline at end of file