How To Use A Global Variable
my_globvar = 0def change_globvar(): global my_globvar # Needed to modify m_globvar my_globvar = 1 # we can change value of global variable change_globvar() print(my_globvar) Younes Derfoufimy-courses.net
How To Convert A Python Variable Type
x = 10print(type(x))// type intx = float(x) print(type(x))// flot type Younes Derfoufimy-courses.net
How To Get A Python Variable Type
x = 5print (type (x)) # x is of type intx = "Hello World"print (type (x)) # x is now of type string Younes Derfoufimy-courses.net
Solution Exercise 62: algorithm that multiplies the elements of a given list
Exercise 62 Given a list of integers L, write an algorithm in Python which multiplies the elements of L of even index by 2 and those of odd index by…
Getting Started With Bootstrap
In this first lesson, we'll start by defining what is Bootstrap. We then show the advantages as well as the limits of this framework so that you immediately have an…
Solution Exercise 61: python algorithm which reverses a given list without using the reverse method
Exercise 61 Resume the previous exercise (Exercise60) without using the reverse() method in python. Solution def reverseList (L): # initialization of the inverted list lReverse = [] # iterate over…
Solution exercise 60: python algorithm that determines the inverse of a list
Exercise 60 Write a Python algorithm that reverse the order of the elements of a list using the reverse() method. Example if L = ['Java', 'Python', 'PHP', 'C ++'], the…