00:26:04 Carlo Giuseppe Tomazzoli: Eroe. 00:26:53 Federica Valeau: professor could you please make the text bigger? 00:29:01 Federica Valeau: yes thank you 00:49:08 Davide Marincione: Personally I love my recursive version 00:49:35 Davide Marincione: Yeah 01:03:30 Ginevra Cepparulo: level 01:03:31 Franciszek Ciecholewski: kobyłamamałybok 01:03:35 Martin Jijena: racecar 01:03:49 Gabriele Scognamiglio: Level 01:03:51 Alessandro vecchi: I topi non avevano nipoti 01:04:01 Alessio Olivieri: nowomannocry 01:04:15 benjamin barda: epoimartinalavavalanatramiope 01:04:21 Barbara Pasquale: roma 01:05:12 benjamin barda: reverse 01:06:58 Carlo Giuseppe Tomazzoli: return word == word[::-1] 01:09:22 Alessandro vecchi: //2+1 01:09:39 Gabriele Scognamiglio: It’s the same 01:10:45 Alessandro vecchi: right 01:15:14 Franciszek Ciecholewski: maybe we should consider lenght of string equal to 0, in the base case 01:15:28 Paolo Gigliesi: yes 01:16:32 Davide Marincione: Aren't slices inefficient? 01:16:51 Davide Marincione: Shouldn't we use indexes like: def check_palindrome(string, indx=0): ret = string[indx] == string[-indx-1] if indx < len(string)//2: return check_palindrome(string, indx+1) \ and ret return ret 01:20:05 Ginevra Cepparulo: You have to remove return false 01:20:17 Davide Marincione: You are returning False on the else 01:20:43 Davide Marincione: Nice 01:22:24 Alessandro vecchi: Sorry prof but should we be able to do the hw7 opt? 01:23:21 Alessandro vecchi: Yes yes I mean how to solve it 01:23:32 Alessandro vecchi: It’s a game tree 01:25:52 Dario Loi: yes, are we gonna learn game trees in the following days? 01:26:35 Barbara Pasquale: Sorry Professor, we just filled the OPIS form for CALCULUS - UNIT 1, does your course has an OPIS code too? Thanks 01:28:34 Alessio Borgi: If you go su infostud and you go to book the exam, there is as prerequisite the filling of the OPIS form. It is linked directly before booking. 01:28:54 Barbara Pasquale: thanks 01:29:05 Alessio Borgi: Welcome 01:35:53 Francesco Danese: sorry why not also 102? 01:36:32 Francesco Danese: oh ok i got it 01:39:19 Francesco Danese: yes yes all clear 01:39:30 Alessandro vecchi: Yeah but how can we remove a char from a string 01:39:50 Alessandro vecchi: The string is immutable 01:39:54 Alessandro vecchi: right 01:40:21 Alessandro vecchi: Yeah but then I have problem with recursion 01:40:35 Ginevra Cepparulo: you split 01:40:36 Alessandro vecchi: split 01:41:19 Alessandro vecchi: Yes yes 01:42:19 Alessandro vecchi: nope 01:47:02 Dario Loi: There is even an itertools method that does this for you 01:47:08 Dario Loi: but we ain't doing that haha 01:49:00 Alessio Olivieri: its 1*2*3 01:49:10 Ginevra Cepparulo: Swapping two elements at a time? 01:49:18 Alessandro vecchi: Def permutations(my_list): if len(my_list)<=1: return [my_list], else: return [perm for i in range(len(e)+1) for e in permutations(my_list[:-1]) 01:49:23 Carlo Giuseppe Tomazzoli: def permutations(numbers): if len(numbers) <= 1: return [numbers] all_permutations = [] for i in range(len(numbers)): item = numbers[i] remaining = numbers[:i] + numbers[i + 1:] for permutation in permutations(remaining): all_permutations.append([item] + permutation) return all_permutations 01:49:24 Alessandro vecchi: I think 01:50:05 Alessandro vecchi: Def permutations(my_list): if len(my_list)<=1: return [my_list], else: return [perm for i in range(len(e)+1) for e in permutations(my_list[:-1]) 01:50:17 Alessandro vecchi: Come si va a capo ahahah 01:50:28 Carlo Giuseppe Tomazzoli: Control + Enter perhaps? 01:50:31 Carlo Giuseppe Tomazzoli: asd 01:50:35 Carlo Giuseppe Tomazzoli: Nope, sorry. 01:50:38 Alessandro vecchi: Nope 01:51:35 Federica Valeau: maybe we could use the index of the original list: so every value has to occupy every position while the other ones are not "moving". So like for every number we move it in every position of the list and we save that sequence 01:53:17 Davide Marincione: SHIFT+ENTER per andare a capo 01:53:43 Alessandro vecchi: asd 01:53:47 Alessandro vecchi: asd 01:54:31 Alessandro vecchi: It doesn’t work 02:04:42 Dario Loi: I can't use len even to evaluate if the list is of len 1? 02:05:52 benjamin barda: if not my_list : return 0 else: return count_elements + 1 02:06:02 Davide Marincione: def count_without_len(lst, indx=0): try lst[indx]: return count_without_len(lst, indx + 1) + 1 except IndexError: return 0 02:06:12 benjamin barda: *return count_elements[1:] + 1 02:06:29 benjamin barda: 2 def count_element(ml): 13 if not ml : 14 return 0 15 else : 16 return count_element(ml[1:])+1 17 18 02:08:18 Davide Marincione: I had an error in the previous one (anyway i know this is lame) def count_without_len(lst, indx=0): try: lst[indx] return count_without_len(lst, indx + 1) + 1 except IndexError: return 0 02:08:22 Nicholas Tiveron: my_list[1] 02:08:58 Alessandro vecchi: The empty list is evaluate as true or false in python? 02:09:04 Gabriele Scognamiglio: false 02:09:18 Alessandro vecchi: thanks 02:09:49 simone cargnin: how can you count in the return 02:09:51 simone cargnin: ? 02:10:33 benjamin barda: only positive or also negative ? 02:10:41 Gabriele Scognamiglio: You just put +1, so at the end is returning 1+1+1+1+1+1+0 02:11:24 simone cargnin: a okok 02:14:08 Carlo Giuseppe Tomazzoli: Not sure, but: 02:14:11 Carlo Giuseppe Tomazzoli: def are_sorted(integers): if len(integers) <= 1: return True if integers[0] < integers[1]: return are_sorted(integers[1:]) return False 02:15:11 Davide Marincione: def is_sorted(lst, indx=1): if len(lst) <= indx: return True if lst[indx - 1] <= lst[indx]: return is_sorted(lst, indx + 1) else: return False 02:17:06 Carlo Giuseppe Tomazzoli: Sorry for not attending, thanks and bye. 02:17:12 Davide Marincione: Yeah, sorry for that 02:17:13 simone cargnin: thanks to you 02:17:14 Davide Marincione: bye! 02:17:15 Maria Emilia Russo: thank you, bye! 02:17:15 Nicholas Tiveron: Thanks, bye! 02:17:16 Iliyas Alimzhan: Thank you bye! 02:17:17 Dario Loi: thank you! 02:17:17 Franciszek Ciecholewski: thank You Sir 02:17:18 Martina Fasiello: bye 02:17:18 Gabriele Scognamiglio: Thank you! 02:17:19 Franciszek Ciecholewski: bye 02:17:19 Paolo Gigliesi: Thanks, bye. 02:17:20 dennis locatelli: bye 02:17:20 giuseppina iannotti: Thanks bye 02:17:21 Dario Loi: Ciao 02:17:21 Alessio Borgi: Thank you 02:17:24 Federica Valeau: bye! 02:17:25 simone cargnin: sorry for nota attending 02:17:33 Alessandro vecchi: Sorry prof but what about the hw4 recovery?