Comment your answers below! 👇 #python #programming #developer #programmer #coding #coder #softwaredeveloper #computerscience #webdev #webdeveloper #webdevelopment #pythonprogramming #pythonquiz #ai #ml #machinelearning #datascience
B) 3333 a = "3" is a string (note the quotes) › a * 3 = "333" (repeats string 3 times) › "333" + a = "3333" (concatenates strings) For beginners: * repeats strings, + joins them! If a was a number (a=3), the answer would be 12.
B) 3333 because in Python, multiplying a string by a number repeats the string, so "3" * 3 gives "333". Adding another "3" (string) results in "3333".😉🤖
>>> a="3" >>> print(a*3)333 >>> print(a*3+3) print(a*3+3) TypeError: can only concatenate str (not "int") to str python.org
Error: string cannot be multiplied with integer
United States الاتجاهات
- 1. Cheney 66K posts
- 2. Sedition 123K posts
- 3. First Take 43.4K posts
- 4. Treason 74.4K posts
- 5. Mark Walter N/A
- 6. Cam Newton 3,528 posts
- 7. Buss 7,752 posts
- 8. #WeekndTourLeaks 1,438 posts
- 9. Jeanie N/A
- 10. Trump and Vance 33.2K posts
- 11. SEDITIOUS BEHAVIOR 25.4K posts
- 12. #ExpediaChat 1,153 posts
- 13. Constitution 94.2K posts
- 14. Commander in Chief 41.1K posts
- 15. Nano Banana Pro 20K posts
- 16. Stephen A 39.9K posts
- 17. #Geeksgiving25 N/A
- 18. Shayy 10.2K posts
- 19. Coast Guard 14.1K posts
- 20. Bush 60.1K posts
Something went wrong.
Something went wrong.