Return | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1


–ü–ĺ–ľ–ĺ–≥–ł—ā–Ķ —Ź —á–į—Ā—ā–ĺ –≤–ł–∂—É —ć—ā–ĺ –≤ –ļ–ĺ–ī–į—Ö –Ĺ–ĺ –Ĺ–Ķ –∑–Ĺ–į—é —á—ā–ĺ —ā–į–ļ–ĺ–Ķ return. ( –ł–∑–ľ–Ķ–Ĺ–Ķ–Ĺ–ĺ 2 ) –ö–į–ļ –ł—Ā–Ņ–ĺ–Ľ—Ć–∑–ĺ–≤–į—ā—Ć –≤–ĺ–∑–≤—Ä–į—ā–Ĺ–ĺ–Ķ —Ā–≤–ĺ–Ļ—Ā—ā–≤–ĺ, –ł —á—ā–ĺ –ĺ–Ĺ–ĺ –ī–Ķ–Ľ–į–Ķ—ā.

2nd Jan 2024, 6:26 PM
Gfy Hgfh
6 Antworten
+ 6
Gfy Hgfh , i can imagine that you are confused by seeing these 2 `return` statements / spellings: return x*2; and the other is return (x+y); you can write it like shown here, all of them are correct: return (x*2); return x*2; return (x+y); return x+y; > the parenthesis () are not required in our samples, so they may be used for a better readability or other purposes. > but there are cases where we need to use parenthesis in calculations - they are giving an expression a *higher priority* as other expressions.
3rd Jan 2024, 12:13 PM
Lothar - avatar
+ 5
"Help, I often see this in codes but I don‚Äôt know what it is" 'return' can be used to end a function and return the result of the function but it's exact usage may depend on which programming language you are using. Be sure to tag your questions with the programming language you're asking about or mention it in the question ūüĎć
2nd Jan 2024, 6:52 PM
Keith - avatar
+ 4
Gfy Hgfh , you are welcome...
3rd Jan 2024, 4:21 PM
Lothar - avatar
+ 3
–°–Ņ–į—Ā–ł–Ī–ĺ –≤—Ā–Ķ–ľ –∑–į –ĺ—ā–≤–Ķ—ā
2nd Jan 2024, 7:39 PM
Gfy Hgfh
+ 2
It is used to announce the final result of calculations in a function. Probably, you've just started learning, so don't worry it will be covered later in the course.
2nd Jan 2024, 7:26 PM
ūüáģūüáĪ Radin Masiha ūüáģūüáĪ
ūüáģūüáĪ Radin Masiha ūüáģūüáĪ - avatar
+ 1
–Ď–ĺ–Ľ—Ć—ą–ĺ–Ķ —Ā–Ņ–į—Ā–ł–Ī–ĺ —Ź –Ī—č –Ĺ–į–≤–Ķ—Ä–Ĺ–ĺ–Ķ –Ĺ–ł–ļ–ĺ–≥–ī–į –Ī—č –Ĺ–Ķ –Ņ–ĺ–Ĺ—Ź–Ľ –Ķ—Ā–Ľ–ł –Ī—č –≤—č –Ĺ–Ķ –ĺ—ā–≤–Ķ—ā–ł–Ľ–ł
3rd Jan 2024, 3:30 PM
Gfy Hgfh