We continue to practice programming. After the sixth chapter in the book: Michael Dawson “Programming in Python”, 2014 (Michael Dawson “Python Programming for the Absolute Beginner”, 3rd Edition), where I learned how to use functions, it’s time to move on to practice. Let’s do our homework together!
Содержание:
Task: Modify the ask_number() or hod_number() function so that it can be called with one more parameter – multiplicity (step size). Set the default stride to 1.
Читать
We continue to practice programming. After the seventh chapter in the book: Michael Dawson “Programming in Python”, 2014 (Michael Dawson “Python Programming for the Absolute Beginner”, 3rd Edition), where I learned how to work with files, it’s time to move on to practice. Let’s do our homework together!
A short summary of working with files in Python
Содержание:
open() – open file and give directory path;
open("file", "r", encoding="utf-8") – open file for reading in Unicode encoding. Читать
We continue to practice programming. After the fourth chapter in the book: Michael Dawson “Programming in Python”, 2014 (Michael Dawson “Python Programming for the Absolute Beginner”, 3rd Edition), where I learned how to use the for statement and create tuples, tasks were suggested. Let’s do them together. I will give my solution, and you write your options in the comments.
1. Write a “Counting” program that would count at the request of the user. We should allow the user to enter the beginning and end of the count, as well as the interval between called integers. Читать
We continue to practice programming. After the fifth chapter in the book: Michael Dawson “Programming in Python”, 2014 (Michael Dawson “Python Programming for the Absolute Beginner”, 3rd Edition), where I learned how to make dictionaries and use lists, it’s time to move on to practice. Let’s do our homework together!
Task: Write a program that will display a list of words in random order. All words from the presented list should be printed on the screen without repetition.
Читать
Продолжаем практиковаться в программировании. После восьмой главы в книге: Майкл Доусон “Программируем на Python”, 2014 (Michael Dawson “Python Programming for the Absolute Beginner”, 3rd Edition), где я изучила принципы ООП и программные объекты / классы, пора переходить к практике. Сделаем домашнее задание вместе!
Программный объект – формальное представление реального объекта в языке программирования. Объекты создаются на основе классов. Читать