Question: Louny String basics, string operations, string slicing, string methods 'Hello Wonar Expected value (always uses as in line 1 above) 1121 lento 151 1119 NS
Louny String basics, string operations, string slicing, string methods 'Hello Wonar Expected value (always uses as in line 1 above) 1121 lento 151 1119 NS SI 132 eins Wat is find Todo For cerrar separate String traversal What does the following program display? def replace it (word, word2): result index = 0 for index in range (0, len (word)): if word1[index] = "-" or word1 [index] ="": result result + word2 else: result result + wordl[index] return result print (replace(778-456 3441","// What does the following program display? der change it (word): result for chin word: itch not in """"): result result + ch return result print (changet(778-456 3441") Lecture 11: Lists List variables, accessing list elements, swap two list elements 1. Write Python code to create a list variable containing 4 first names. The last name must be your own name. 2. Write an assignment statement to change your name to Karl". 3. Write an assignment statement to change the first name to "Dan". 4. Write code to exchange "Dan" (the first name in the list) and "Karl" (the last one) in the list. List membership test What does the following program display? ch = "/" resulta - ch in [..","") results - ch not in "-", "/": print (resulta, results) List traversal List methods: append, Insert, remove, index, reverse, sort. Built-in functions for lists List parameters for functions Lists returned from a function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
