Repository navigation
Conversation
brianilles
left a comment
There was a problem hiding this comment.
Great work on the first 2 days. Will keep this PR open in case you are considering the stretch assignment
| @@ -1 +1,2 @@ | |||
| # Print "Hello, world!" to your terminal No newline at end of file | |||
| # Print "Hello, world!" to your terminal | |||
| print("Hello, world!") No newline at end of file | |||
There was a problem hiding this comment.
It all starts with a hello world :)
|
|
||
| # YOUR CODE HERE No newline at end of file | ||
| # YOUR CODE HERE | ||
| print(2**65536) No newline at end of file |
There was a problem hiding this comment.
What happens in the JS console?
|
|
||
| # YOUR CODE HERE No newline at end of file | ||
| # YOUR CODE HERE | ||
| print(str(x) + y) No newline at end of file |
There was a problem hiding this comment.
When we do int(y) or str(x), what is this called?
| # Print out the command line arguments in sys.argv, one per line: | ||
| # YOUR CODE HERE | ||
| for argument in sys.argv: | ||
| print(argument) |
| print("x is {0}, y is {1:1.2f}, z is \"{2}\"".format(x, y, z)) | ||
|
|
||
| # Finally, print the same thing using an f-string | ||
| print(f"x is {x}, y is {round(y, 2)}, z is \"{z}\"") |
There was a problem hiding this comment.
Excellent use of all three print implementations. Which is your fav?
|
|
||
| # What do you need between the square brackets to make it work? | ||
| y = [] | ||
| y = [even for even in x if int(even) % 2 == 0] |
There was a problem hiding this comment.
Best I've seen yet! even for even really makes this readable.
|
|
||
| return True | ||
|
|
||
| return False |
There was a problem hiding this comment.
Solid! One thing you may see others do is return n%2 == 0 which will return a Boolean itself. Either way is valid of course.
| # sum. Google for "python arbitrary arguments" and look for "*args" | ||
|
|
||
| # YOUR CODE HERE | ||
| def f2(*args): |
There was a problem hiding this comment.
Nice! What operator in JS is *args like?
No description provided.