import PySide2.QtCore

# Prints PySide2 version
# e.g. 5.11.1a1
print(PySide2.__version__)

# Gets a tuple with each version component
# e.g. (5, 11, 1, 'a', 1)
print(PySide2.__version_info__)

# Prints the Qt version used to compile PySide2
# e.g. "5.11.2"
print(PySide2.QtCore.__version__)

# Gets a tuple with each version components of Qt used to compile PySide2
# e.g. (5, 11, 2)
print(PySide2.QtCore.__version_info__)

print(PySide2.QtCore.qVersion())


'''
PySide2
'''

import sys
try:
    import PySide2.QtCore
except ImportError:
    print('cannot load module: PySide2.QtCore')
    sys.exit(1)

# Prints PySide2 version
# e.g. 5.11.1a1
print(PySide2.__version__)

# Gets a tuple with each version component
# e.g. (5, 11, 1, 'a', 1)
print(PySide2.__version_info__)

# Prints the Qt version used to compile PySide2
# e.g. "5.11.2"
print(PySide2.QtCore.__version__)

# Gets a tuple with each version components of Qt used to compile PySide2
# e.g. (5, 11, 2)
print(PySide2.QtCore.__version_info__)

print(PySide2.QtCore.qVersion())

ADD try-except to handle import error
ADD try-except to handle import error

+ 
+ '''
+ PySide2
+ '''
+ 
+ import sys
+ try:
- import PySide2.QtCore
+     import PySide2.QtCore
+ except ImportError:
+     print('cannot load module: PySide2.QtCore')
+     sys.exit(1)
  
  # Prints PySide2 version
  # e.g. 5.11.1a1
  print(PySide2.__version__)
  
  # Gets a tuple with each version component
  # e.g. (5, 11, 1, 'a', 1)
  print(PySide2.__version_info__)
  
  # Prints the Qt version used to compile PySide2
  # e.g. "5.11.2"
  print(PySide2.QtCore.__version__)
  
  # Gets a tuple with each version components of Qt used to compile PySide2
  # e.g. (5, 11, 2)
  print(PySide2.QtCore.__version_info__)
  
  print(PySide2.QtCore.qVersion())
  
ADD try-except to handle import error
## Code Before:
import PySide2.QtCore

# Prints PySide2 version
# e.g. 5.11.1a1
print(PySide2.__version__)

# Gets a tuple with each version component
# e.g. (5, 11, 1, 'a', 1)
print(PySide2.__version_info__)

# Prints the Qt version used to compile PySide2
# e.g. "5.11.2"
print(PySide2.QtCore.__version__)

# Gets a tuple with each version components of Qt used to compile PySide2
# e.g. (5, 11, 2)
print(PySide2.QtCore.__version_info__)

print(PySide2.QtCore.qVersion())

## Instruction:
ADD try-except to handle import error
## Code After:

'''
PySide2
'''

import sys
try:
    import PySide2.QtCore
except ImportError:
    print('cannot load module: PySide2.QtCore')
    sys.exit(1)

# Prints PySide2 version
# e.g. 5.11.1a1
print(PySide2.__version__)

# Gets a tuple with each version component
# e.g. (5, 11, 1, 'a', 1)
print(PySide2.__version_info__)

# Prints the Qt version used to compile PySide2
# e.g. "5.11.2"
print(PySide2.QtCore.__version__)

# Gets a tuple with each version components of Qt used to compile PySide2
# e.g. (5, 11, 2)
print(PySide2.QtCore.__version_info__)

print(PySide2.QtCore.qVersion())
