Questions

  1. How many characters will be printed from the following code?
#!/usr/bin/python3str = "Testing Python.."print(str[8:])
  1. How many words will be printed from the following code?
#!/usr/bin/python3print( len(sys.argv) )Solution: Nothing
  1. How many words will be printed from the following code?
#!/usr/bin/python3import sysprint("Hello " + sys.argv[-1])

Get Mastering Linux Shell Scripting now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.