|
| 1 | +def __main__global_stmts(): |
| 2 | + my_first_list = [1, 2, 3, 4, 5] |
| 3 | + print(my_first_list) |
| 4 | + my_first_list.append(4) |
| 5 | + my_first_list.remove(2) |
| 6 | + print(my_first_list.count(4)) |
| 7 | + my_first_list.insert(0, 1) |
| 8 | + my_first_list.clear() |
| 9 | + my_second_list = [1.200000, 4.300000, 2.800000] |
| 10 | + print(my_second_list) |
| 11 | + my_second_list.append(4.300000) |
| 12 | + my_second_list.remove(2.800000) |
| 13 | + print(my_second_list.count(4.300000)) |
| 14 | + my_second_list.insert(0, 3.300000) |
| 15 | + my_second_list.clear() |
| 16 | + my_third_list = ["hello", "world", "lpython"] |
| 17 | + print(my_third_list) |
| 18 | + my_third_list.append("hello") |
| 19 | + my_third_list.remove("world") |
| 20 | + print(my_third_list.count("hello")) |
| 21 | + my_third_list.insert(0, "hi") |
| 22 | + my_third_list.clear() |
| 23 | + my_fourth_list = [(1.200000, 4.300000), (2.800000, 3.300000)] |
| 24 | + print(my_fourth_list) |
| 25 | + my_fourth_list.append((1.600000, 2.200000)) |
| 26 | + my_fourth_list.remove((1.200000, 4.300000)) |
| 27 | + print(my_fourth_list.count((2.800000, 3.300000))) |
| 28 | + my_fourth_list.insert(0, (1.000000, 0.000000)) |
| 29 | + my_fourth_list.clear() |
| 30 | + f() |
| 31 | +def f(): |
| 32 | + my_first_list: list[i32] |
| 33 | + my_fourth_list: list[tuple[f64, f64]] |
| 34 | + my_second_list: list[f64] |
| 35 | + my_third_list: list[str] |
| 36 | + my_first_list = [1, 2, 3, 4, 5] |
| 37 | + print(my_first_list) |
| 38 | + my_first_list.append(4) |
| 39 | + my_first_list.remove(2) |
| 40 | + print(my_first_list.count(4)) |
| 41 | + my_first_list.insert(0, 1) |
| 42 | + my_first_list.clear() |
| 43 | + my_second_list = [1.200000, 4.300000, 2.800000] |
| 44 | + print(my_second_list) |
| 45 | + my_second_list.append(4.300000) |
| 46 | + my_second_list.remove(2.800000) |
| 47 | + print(my_second_list.count(4.300000)) |
| 48 | + my_second_list.insert(0, 3.300000) |
| 49 | + my_second_list.clear() |
| 50 | + my_third_list = ["hello", "world", "lpython"] |
| 51 | + print(my_third_list) |
| 52 | + my_third_list.append("hello") |
| 53 | + my_third_list.remove("world") |
| 54 | + print(my_third_list.count("hello")) |
| 55 | + my_third_list.insert(0, "hi") |
| 56 | + my_third_list.clear() |
| 57 | + my_fourth_list = [(1.200000, 4.300000), (2.800000, 3.300000)] |
| 58 | + print(my_fourth_list) |
| 59 | + my_fourth_list.append((1.600000, 2.200000)) |
| 60 | + my_fourth_list.remove((1.200000, 4.300000)) |
| 61 | + print(my_fourth_list.count((2.800000, 3.300000))) |
| 62 | + my_fourth_list.insert(0, (1.000000, 0.000000)) |
| 63 | + my_fourth_list.clear() |
0 commit comments