Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

func_e13xx.py 785B

123456789101112131415161718192021
  1. """test string format error
  2. """
  3. # pylint: disable=print-statement,unsupported-binary-operation
  4. from __future__ import print_function
  5. PARG_1 = PARG_2 = PARG_3 = 1
  6. def pprint():
  7. """Test string format
  8. """
  9. print("%s %s" % {'PARG_1': 1, 'PARG_2': 2}) # E1306
  10. print("%s" % (PARG_1, PARG_2)) # E1305
  11. print("%(PARG_1)d %d" % {'PARG_1': 1, 'PARG_2': 2}) # E1302
  12. print("%(PARG_1)d %(PARG_2)d" % {'PARG_1': 1}) # E1304
  13. print("%(PARG_1)d %(PARG_2)d" % {'PARG_1': 1, 'PARG_2':2, 'PARG_3':3}) #W1301
  14. print("%(PARG_1)d %(PARG_2)d" % {'PARG_1': 1, 2:3}) # W1300 E1304
  15. print("%(PARG_1)d %(PARG_2)d" % (2, 3)) # 1303
  16. print("%(PARG_1)d %(PARG_2)d" % [2, 3]) # 1303
  17. print("%2z" % PARG_1)
  18. print("strange format %2" % PARG_2)
  19. print("works in 3 %a" % 1)