Solutions to practice | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Solutions to practice

Please help. Who knows where solutions to practical tasks can be found? How can we check our codes?

29th Apr 2021, 2:20 PM
Елена Леващева
Елена Леващева - avatar
61 Answers
+ 3
Nowhere, these tasks are not for "copy paste", it would not make sense if you could find solutions. If you have problems, ask for help here, but don't expect anyone to give you code if you did not try solving it yourself
29th Apr 2021, 2:23 PM
Michal Doruch
+ 3
And you can check if your code produces correct results by hitting Run
29th Apr 2021, 3:29 PM
Benjamin Jürgens
Benjamin Jürgens - avatar
+ 2
Thanks a lot for your replies. I will think about it. But are you sure that if your first teacher just gave you alphabet without many examples how to use it you would be able to learn reading?
30th Apr 2021, 1:55 AM
Елена Леващева
Елена Леващева - avatar
+ 2
6.2 Practice. Textbook for students. There, it is said you should use %. I didn't (because I didn't know what for). But the result is ok. So what? Is my code good? Is it DRY or WET?
30th Apr 2021, 2:48 AM
Елена Леващева
Елена Леващева - avatar
+ 2
You know I think I understood the reason why task solutions are not given. This has given the best thing about Sololearn, namely it is community!!. I have just read one kid message, he was suffering from cerebral palsy. He was scared after talking with his doctor. It was three years ago. 27 people responded, they tried their best to support him. I never forget this.
30th Apr 2021, 12:58 PM
Елена Леващева
Елена Леващева - avatar
+ 2
your new solution is wrong. your program will be damaged by this. it will stop working at other input values. the task of the programmer is to make a universal program for any values and also to provide all possible options for entering incorrect data. This is my solution: need_book = ((group1 * 2) + (group2 * 2)) remains_book = books % need_book print(remains_book)
3rd May 2021, 8:05 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 2
Thank you very much both for your advice and joke. Both are great! 😂 I will change the code and let everyone know. But again the system accepted my second incorrect code. We apparently need to ask Sololearn to provide us with the best solutions. At least after our kind of solving a task in any format (txt)
3rd May 2021, 8:58 AM
Елена Леващева
Елена Леващева - avatar
+ 2
Thanks a lot!!!!! Now i start understanding what i am doing
3rd May 2021, 9:50 AM
Елена Леващева
Елена Леващева - avatar
+ 2
That is the updated group1 = 18 group2 = 19 avl_book = 76 need_book = ((group1 * 2) + (group2 * 2)) remains_book = avl_book % need_book print(remains_book)
3rd May 2021, 10:20 AM
Елена Леващева
Елена Леващева - avatar
+ 2
Ярослав thanks a lot. You are the best teacher. I will remember about this lesson. To say that it helped to say nothing. This lesson is worth to be published.
3rd May 2021, 10:24 AM
Елена Леващева
Елена Леващева - avatar
+ 2
Joke about a tester is nothing comparing to this
3rd May 2021, 10:36 AM
Елена Леващева
Елена Леващева - avatar
+ 2
Is it better? group1 = int(input()) group2 = int(input()) avl_book = int(input()) need_book = ((group1 * 2) + (group2 * 2)) remains_book = avl_book % need_book print(remains_book)
3rd May 2021, 10:54 AM
Елена Леващева
Елена Леващева - avatar
+ 2
Все равно буду изучать, если только не пойму, что все упёрлась в стену
3rd May 2021, 12:58 PM
Елена Леващева
Елена Леващева - avatar
+ 2
Спасибо, Вы так хорошо умеете всё объяснить. Здорово! Мы говорим про оперативную память и получается, что разворачивание программы (создание переменных) происходит в оперативной памяти. А сама программа есть файл в виде набора инструкций и находится на жёстком диске. Все что мы создали и сохранили (например таблица в ексел) не вносит изменения в программу, а создаётся в виде файла, который тоже сохраняется где-то на жёстком диске. Мне кажется, что мне понятно. Спасибо огромное ещё раз. Хорошего дня.
4th May 2021, 5:20 AM
Елена Леващева
Елена Леващева - avatar
+ 1
why excel? not a word? 🤭 The operator of the remainder of the number % (for example: 17 % 3 = 2) 1. Take the nearest number when divided by 3 would be zero. That's apparently 15 2. Subtract 15 from 17 and the result is your answer.
3rd May 2021, 7:57 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 1
Заходит однажды тестировщик в бар... Забегает в бар. Пролезает в бар. Танцуя, проникает в бар. Крадется в бар. Врывается в бар. Прыгает в бар ...и заказывает: кружку пива, 2 кружки пива, 0 кружек пива, 999999999 кружек пива, ящерицу в стакане, -1 кружку пива, qwertyuip кружек пива. После открытия пользователь заходит в бар через окно и спрашивает: "где у вас туалет?" Бар крашится...
3rd May 2021, 8:10 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 1
About word or Excel.. I bet Excel is better for this purpose You can make kind of database . It is better to look through then.
3rd May 2021, 9:05 AM
Елена Леващева
Елена Леващева - avatar
+ 1
The code has been successfully accepted. need_book = ((18*2) + (19*2)) remains_book = 76 % need_book print(remains_book) Thanks again.
3rd May 2021, 9:34 AM
Елена Леващева
Елена Леващева - avatar
+ 1
😂😂😂😂 i will certainly correct
3rd May 2021, 10:34 AM
Елена Леващева
Елена Леващева - avatar