Lesson 3 Task 7
See original GitHub issueI’m not sure what the expected result was on this one but I don’t think it’s what I’m getting. I tried multiple things until I could get it to work though. However the first one to work doesn’t seem right as it returned
Traceback (most recent call last):
File "C:/Users/Alexander/PycharmProjects/PythonIntroduction/lesson3/task7/len_function.py", line 6, in <module>
first_half = int(phrase[:43])
ValueError: invalid literal for int() with base 10: '\nIt is a really long string\ntriple-quoted s'
With the input of
phrase = """
It is a really long string
triple-quoted strings are used
to define multi-line strings
"""
first_half = int(phrase[:43])
print(first_half)
And then passes the lesson.
Issue Analytics
- State:
- Created 9 years ago
- Comments:18 (4 by maintainers)
Top Results From Across the Web
College Readiness Mathematics. Unit 3. Lesson 4
Task #7: Scaling Activity. Look at the two pictures below. The first picture is the Washington Monument in Washington DC. The second is...
Read more >unit5lesson3task7.pdf - Student Manual Math Ready . Unit 5...
Lesson 3Task #7: Systems of Linear Equations Practice1. An appliance store sells a washer-dryer combination for $1,500. If the washer costs $200 morethan ......
Read more >College Readiness Mathematics - Georgia Standards
Algebraic Expressions. LESSON 1 OF 7. Task #3: Felicia's Drive. As Felicia gets on the freeway to drive to her cousin's house, she...
Read more >Bridge to College Mathematics . Unit 1 . Lesson 3 Task #7
Lesson 3. Task #7: A Night Out. (1) A new miniature golf and arcade opened up in town. For convenient ordering, a play...
Read more >Math Ready . Unit 6 . Lesson 3 - SCHOOLinSITES
Based on our work in this lesson and your work in the linear unit (Unit 3) ... Student Manual. Math Ready . Unit...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@shake360
phrase = “”" It is a really long string triple-quoted strings are used to define multi-line strings “”" first_half = phrase[:int(len(phrase)/2)] print(first_half)
This is what you should have
@shake360 That’s a correct logic but you forgot to use slicing, for now you store the number 44 in the
first_half
variable, not a first half of the phrase itself as expected.