Assignment-2: List | Tuples | Dictionaries

Hello i have one daut realted to Assignment-2: List | Tuples | Dictionaries in that 2nd question “Write a Python program to print a dictionary whose keys should be the alphabet from a-z and the value should be corresponding ASCII values” in that question i need to take input from user or not and second is it compalsory to use function or i use simply for loop @shivrajrtandale98 .

1 Like

Function is not mandatory it is your own choice…but taking input from the user is mandatory

1 Like

Okay Thanks for confirmation.

@zk6290254938 But how we get input here we need to dict right so if i enter any text then it will print output in key value pair then why i need to take input from user ?

1 Like

@harshdip1804
Take user input for which range of alphabets he wants to print letter and ASCII values as key value pair so that your code will become flexible to print any range of letters and their ASCII values in dictionary form as per user choice.
Thanks

1 Like

@kaushal-ta-ds Oh ok so for example i enter my name or enter only h as input then it should be print like in dict {‘h’:104} like this ?

1 Like

@kaushal-ta-ds @zk6290254938 @shivrajrtandale98 Enter a string: harsh
{‘h’: 104, ‘a’: 97, ‘r’: 114, ‘s’: 115} like this is it okay ?

1 Like

@harshdip1804

Right that is the way

1 Like

@zk6290254938

Thanks for the confirmation. I think I’m asking you the same in my post

@zk6290254938 Thanks

@harshdip1804
Yes offcourse.
Hope you have completed your assignment.
@skggote
@harshdip1804
If any more doubt you can ask :heart:

1 Like

@kaushal-ta-ds yes i completed assignment thnaks for connecting .

1 Like

Hello @zk6290254938 @kaushal-ta-ds @shivrajrtandale98 Hello may i know what the hell is happening here we alredy tell all of you the excepted output is looks like this ({‘h’: 104, ‘a’: 97, ‘r’: 114, ‘s’: 115} then why again You cut the marks ? may i know reason?

1 Like

Hello… @harshdip1804 You have to print dictionary for all the alphabets i.e. your output must be this
{‘a’: 97, ‘b’: 98, ‘c’: 99, ‘d’: 100, ‘e’: 101, ‘f’: 102, ‘g’: 103, ‘h’: 104, ‘i’: 105, ‘j’: 106, ‘k’: 107, ‘l’: 108, ‘m’: 109, ‘n’: 110, ‘o’: 111, ‘p’: 112, ‘q’: 113, ‘r’: 114, ‘s’: 115, ‘t’: 116, ‘u’: 117, ‘v’: 118, ‘w’: 119, ‘x’: 120, ‘y’: 121, ‘z’: 122}

1 Like

Hello did u see above comments ?
@shivrajrtandale98

@shivrajrtandale98 see this Alreday two TA says me this correct

if ur doing like this then why we need to take assignment serious ? in first assignment also none of u mentioned take input there alreday u cut 15 marks and now again here i alreday confirm what is excepted output TWO TA said its correct then why again cut my marks ?
@shivrajrtandale98 @zk6290254938 @kaushal-ta-ds

1 Like

@harshdip1804 Don’t worry… I will reassign grades… Assignments are there only for you. So that you can practice more & get certificate with good grades on it.

Yes actually but if i am writing correct and then again if i loss marks then it hurts @shivrajrtandale98 Sorry if u think i m overexcited but alreday i confirm thats why i told You .

1 Like