Questions

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

  1. How many words will be printed from the following code?
#!/usr/bin/python3
import sys
print("Hello " + sys.argv[-1])