-2

I am learning how to use the coding. I typed like mood = happy before. So, I looked the book "Coding for Kids Python" and I am clueless after I was told how to follow this the sentence. "Today, I feel curious!" with f-strings. I typed this way:

print(f"Today, I feel {mood}.") 

and it came "happy" instead curious. How to replace or switch the words happy to curious? Thanks.

andrewJames
  • 19,570
  • 8
  • 19
  • 51
  • Welcome to SO! Try using `mood = "curious"` instead of `mood = "happy"`. You can set the variable `mood` to any string you want (I am assuming `happy` isn't a variable itself here, if it is, keep backing up until you find the place you've assigned it to a string (text with quotes around it)). – ggorlen May 26 '20 at 22:17

1 Answers1

0
mood = 'happy'

print(f"Today, I feel {mood}.") 

mood = 'curious'

print(f"Today, I feel {mood}.") 

You have to redefine variables if you want mood to be something else. The above code will give you different statements because I've redefined the variable prior to running the print statement.

Burnstrike
  • 71
  • 4