What will be the output of this code using f- strings?
122
39
546
114
65K
F-strings are used to concatenate variables in python. So it add the value of the variable to the string. Variable "name" value is Alice, and variable "age" value is 30. Adding that to the string gives: Alice is 30 years old
0
0
5
1
2K
C The F string prints formatted text a single line including variables. Without the f string it displays: {name} is{age} years old
0
0
4
0
2K
Answer is C. Name has been assigned the value of "Alice" name = "Alice" Age has been assigned the value of of "30" age = "30" The F string allows this to be printed as "Alice is 30 years old."
0
0
4
0
242
United States Trends
- 1. $BNKK N/A
- 2. Pond 201K posts
- 3. Good Monday 39.2K posts
- 4. #MondayMotivation 36.8K posts
- 5. Happy 250th 4,636 posts
- 6. Semper Fi 5,055 posts
- 7. Go Birds 3,566 posts
- 8. Obamacare 20.7K posts
- 9. $LMT $450.50 Lockheed F-35 N/A
- 10. $SENS $0.70 Senseonics CGM 1,068 posts
- 11. $APDN $0.20 Applied DNA 1,041 posts
- 12. Victory Monday 1,701 posts
- 13. Rudy Giuliani 25K posts
- 14. #Talus_Labs N/A
- 15. #SoloLaUniónNosHaráLibres 1,264 posts
- 16. #MondayVibes 2,714 posts
- 17. #USMC N/A
- 18. Edmund Fitzgerald 4,498 posts
- 19. LINGLING BA HERHYNESS 575K posts
- 20. The BBC 494K posts
Loading...
Something went wrong.
Something went wrong.