Skip to content

Commit 16ebcfb

Browse files
committed
fixes
1 parent 3bcec58 commit 16ebcfb

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

_sources/functions/func_Str_Cond.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ You can get a copy of part or all of a string using ``str_name[start:end]``.
235235
Basic Conditionals and Tests
236236
============================
237237

238+
You can execute code only when a condition is true using ``if``. You can execute one block of code when a condition is true (using ``if``) or false (using ``else``). You can even speicfy more than two outcomes as shown in the code below.
239+
238240
.. fillintheblank:: fsc_fitb_return_temp_first_line
239241

240242
What is the first thing (first line of text) that will be printed when the code below runs?

pretext/functions/funcWithStrsAndConds.ptx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,13 +455,13 @@ main()
455455
# function definition
456456
def get_temp_desc(temp):
457457
if temp < 32:
458-
return "Baby, its cold outside!"
458+
return "Baby, its cold outside! The temp is " + str(temp)
459459
elif temp < 70:
460-
return "Wear a coat"
460+
return "Wear a coat The temp is " + str(temp)
461461
elif temp < 80:
462-
return "Feels great!"
462+
return "Feels great! The temp is " + str(temp)
463463
else:
464-
return "Too hot to handle!"
464+
return "Too hot to handle! The temp is " + str(temp)
465465

466466
# function definition
467467
def main():

0 commit comments

Comments
 (0)