Solution Exercise 11: Multiply the elements of a Python list by a given integer
Exercise 11 Write an algorithm in python as a function which takes as parameter a tuple (L, n) formed by a list L of numbers and an integer n and…
Python Courses & Exercises with solutions !
Exercise 11 Write an algorithm in python as a function which takes as parameter a tuple (L, n) formed by a list L of numbers and an integer n and…
Exercise 10 Write an algorithm in python as a function which takes as a parameter a tuple (L, x) formed by a list L and an element x and which…
Exercise9 Write an algorithm in python as a function which takes as parameter a tuple (L, a) formed by a list L and an element a and which returns True…
Exercise8 Write an algorithm in python that returns the average of the terms in a list of numbers. Solution def averageList (L): # initialization of the average m = 0…
Source code import sysfrom PyQt5.QtWidgets import QApplication, QWidget, QPushButton , QGridLayoutdef window(): app = QApplication(sys.argv) win = QWidget() grid = QGridLayout() grid.addWidget(QPushButton("Button 1") , 0 , 0) grid.addWidget(QPushButton("Button 2") ,…
import sysfrom PyQt5.QtWidgets import QApplication, QWidget, QLineEditdef onChangeText(): Text = fieldEdit.text() print(Text)app = QApplication(sys.argv) widget = QWidget() fieldEdit = QLineEdit(widget)fieldEdit.move(70 , 20)fieldEdit.resize(200 , 30)fieldEdit.textChanged.connect(onChangeText)widget.setGeometry(100,100,400,200) widget.setWindowTitle("QLineEdit Input Text Field !") widget.show()sys.exit(app.exec_())…
import sysfrom PyQt5.QtWidgets import QApplication, QWidget, QPushButtondef buttonAction(): print("You clicked on the button !")app = QApplication(sys.argv)widget = QWidget()myButton = QPushButton(widget)myButton.setText("Click here !")myButton.move(50 , 30)myButton.clicked.connect(buttonAction)widget.setGeometry(100, 100 , 320 , 200)widget.setWindowTitle("Example of…