Geek is learning a new programming language. As data type forms the most fundamental part of a language, Geek is learning them with focus and needs your help. Given a data type, help Geek in finding the size of it in byte.
Data Type - Character, Integer, Long, Float and Double
Example 1:
Input: Character
Output: 1
Example 2:
Input: Integer
Output: 4
 
Your Task:
Complete the function dataTypeSize() which takes a string as input and returns the size of the data type represented by the given string in byte unit.

Source: geeksforgeeks | Difficulty: EASY

Starter code: #User function Template for python3



class Solution:

    def dataTypeSize(self, str):

        # Code here

Solutions:
class Solution:

	def dataTypeSize(self, str):
		if str == 'Character':
			return 1
		elif str == 'Integer':
			return 4
		elif str == 'Float':
			return 4
		elif str == 'Long':
			return 8
		elif str == 'Double':
			return 8


class Solution:

	def dataTypeSize(self, str):
		d = {'Character': 1, 'Integer': 4, 'Long': 8, 'Float': 4, 'Double': 8}
		return d[str]


class Solution:

	def dataTypeSize(self, str):
		data_type = {'Character': 1, 'Integer': 4, 'Float': 4, 'Double': 8, 'Long': 8}
		if str in data_type:
			return data_type.get(str)


class Solution:

	def dataTypeSize(self, data_type):
		if data_type == 'Character':
			return 1
		elif data_type == 'Integer':
			return 4
		elif data_type == 'Long':
			return 8
		elif data_type == 'Float':
			return 4
		else:
			return 8


import sys

class Solution:

	def dataTypeSize(self, str):
		sizes = {'Character': 1, 'Integer': 4, 'Long': 8, 'Float': 4, 'Double': 8}
		return sizes.get(str)


import sys

class Solution:

	def dataTypeSize(self, str):
		if str[0] == 'C':
			return 1
		elif str[0] == 'I':
			return 4
		elif str[0] == 'F':
			return 4
		elif str[0] == 'D':
			return 8
		else:
			return 8


class Solution:

	def dataTypeSize(self, str):
		if str == 'Character':
			return 1
		elif str == 'Integer':
			return 4
		elif str == 'Long':
			return 8
		elif str == 'Float':
			return 4
		elif str == 'Double':
			return 8
		else:
			return 'Unknown data type'


class Solution:

	def dataTypeSize(self, str):
		if str == 'Character':
			return 1
		elif str == 'Integer' or str == 'Float':
			return 4
		else:
			return 8


import sys

class Solution:

	def dataTypeSize(self, str):
		if str == 'Character':
			return 1
		elif str == 'Integer':
			return 4
		elif str == 'Float':
			return 4
		elif str == 'Double':
			return 8
		else:
			return 8