Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Swift Basics Swift Operators Working With Operators: Part 2

i'm having a problem with unary plus operater

i do not know where i'm getting wrong ????

operators.swift
// Enter your code below

var initialScore = 1
initialScore += 1

1 Answer

Mike Bailey
Mike Bailey
823 Points

Your attached code works fine...

var initialScore = 1 ///score equals 1)
initialScore += 1 ///score now equals 2)
initialScore += 1 ///score now equals 3)
///etc...

However, if you're if you're using this code to complete the code challenge in the Working with Operators (Swift 3 Basics) the first initialScore should be set to 8...

var initialScore = 8
initialScore += 1

Hope this helps...

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi Mike! I moved your comment to an answer so that the question will be marked as answered on the forums and so that your answer may be eligible for up voting and possible selection for "Best Answer". Thanks for helping out in the Community! :sparkles: