Loading...

Във форума е въведено ограничение, което позволява на потребителите единствено да разглеждат публикуваните въпроси.

Milvenaa avatar Milvenaa 0 Точки

5. Travelling

Как да продължа след това:

destination = input()
min_budget = int(input())
needed_money = 0
while min_budget >= needed_money:
    tips = int(input())
    needed_money += tips
    if min_budget <= needed_money:
        print(f'Going to {destination}!')
        break

Задачата е номер 5 https://softuni.bg/trainings/resources/officedocument/46630/lab-problem-descriptions-programming-basics-with-python-january-2020/2666

0
DeveloperEnthusiast avatar DeveloperEnthusiast 303 Точки
destination = input()  # това ти е еквивалент на command, който се презаписва накрая на цикъла

while destination != 'End':  # трябва ти цикъл, който проверява дали command/destination e 'End'
    min_budget = float(input())  # трябва да е float иначе ще получиш Runtime error на скрити тестове
    needed_money = 0

    while min_budget > needed_money:  # не трябва да влиза в цикъла когато са равни
        tips = float(input())  # същата работа като min_budget - ще се чудиш защо гърми
        needed_money += tips

    print(f'Going to {destination}!')  # достига се и печата, когато вложеният цикъл приключи

    destination = input() # презаписва се и ако е 'End' програмата приключва, иначе започва от начало

 

1
20/02/2020 02:41:28
MBran avatar MBran 1 Точки

Благодаря за отговора и аз! Преди ми даваше само runtime error и се оказа, че просто един ред ми е излишен :)

1
Laus1986 avatar Laus1986 9 Точки

Traveling is one of the best things that most people want to do and there are many Vacation Packages available that can provide the real travel facility to anyone who wants to travel and enjoy the holidays in different places of the world.

0
asad664 avatar asad664 47 Точки

An intriguing discussion is worth comment.Retirement Villages in the Philippines I think that you ought to publish more on this subject matter, it might not be a taboo matter but generally, people don't discuss these issues. To the next! Kind regards!!

0
asad664 avatar asad664 47 Точки

This article could not be written any better! Reading through this post reminds me of my previous Hotels in edinburgh roommate! He continually kept preaching about this. I'll forward this post to him. Pretty sure he'll have a very good read. Thank you for sharing!
 

0
asad664 avatar asad664 47 Точки

An impressive share! I have just forwarded this onto a friend who had been doing a little homework on this. And he in fact ordered me dinner because I stumbled upon it for him... lol. So let me reword this.... Thank YOU for the meal!! But yeah, thanks for spending the time to talk about this 7daysabroad.com topic here on your website.
 

0
asad664 avatar asad664 47 Точки

I’m impressed, I must say. Seldom do I come across a blog that’s both equally educative and interesting, and without a doubt, you've hit the nail on the head. The issue is something that not enough folks are speaking intelligently Tour in sri lanka about. Now i'm very happy I came across this during my search for something relating to this.
 

0
Можем ли да използваме бисквитки?
Ние използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Можете да се съгласите с всички или част от тях.
Назад
Функционални
Използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Използваме „сесийни“ бисквитки, за да Ви идентифицираме временно. Те се пазят само по време на активната употреба на услугите ни. След излизане от приложението, затваряне на браузъра или мобилното устройство, данните се трият. Използваме бисквитки, за да предоставим опцията „Запомни Ме“, която Ви позволява да използвате нашите услуги без да предоставяте потребителско име и парола. Допълнително е възможно да използваме бисквитки за да съхраняваме различни малки настройки, като избор на езика, позиции на менюта и персонализирано съдържание. Използваме бисквитки и за измерване на маркетинговите ни усилия.
Рекламни
Използваме бисквитки, за да измерваме маркетинг ефективността ни, броене на посещения, както и за проследяването дали дадено електронно писмо е било отворено.