Skip to content

Update 02-collections.slim #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 3, 2014
Merged

Update 02-collections.slim #17

merged 1 commit into from
Apr 3, 2014

Conversation

vpnachev
Copy link
Contributor

Конкатенацията работи върху списъци, а num не е число, следователно трябва да го конвертираме в списък. А за да получим изречение "I really like the number 72", то 72 трябва да е по-специално низ.

@smarnv
Copy link
Contributor

smarnv commented Mar 18, 2014

Друга една възможност би била числото да не се пипа и да се принтира с изброяване: print("I really like the number", num). В този случай е важно да се разкара крайният интервал от низа преди числото, за да не остане двоен. print() автоматично си разделя аргументите с интервал освен ако не му презапишем параметъра sep=' '. Това има и предимството, че не се интересува дали num е число, или пък е низ (на мен лично не ми става ясно от отрязъка код).

vladimiroff added a commit that referenced this pull request Apr 3, 2014
Update 02-collections.slim
@vladimiroff vladimiroff merged commit 915731a into fmi:master Apr 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants