+ 3

How to store inputs in dictionary

21st Apr 2021, 6:56 AM
Codemurai
Codemurai - avatar
7 odpowiedzi
21st Apr 2021, 8:18 AM
Simba
Simba - avatar
+ 4
input =input() dict = { 'date':'21', 'month': 'april', 'year': '2021', } print(dict[input])
21st Apr 2021, 7:59 AM
Scarlet Witch
Scarlet Witch - avatar
21st Apr 2021, 8:42 AM
Scarlet Witch
Scarlet Witch - avatar
+ 1
Jan Markus Question :- How do I put input in dictionary I don't what the use of it but I need to know how to put input in dictionary
21st Apr 2021, 7:41 AM
Codemurai
Codemurai - avatar
+ 1
Simba Sorry, I mean how do I put input in dictionary
21st Apr 2021, 7:56 AM
Codemurai
Codemurai - avatar
+ 1
Simba For example My input is 'hello world' We need to store it in dictionary
21st Apr 2021, 7:57 AM
Codemurai
Codemurai - avatar
+ 1
Scarlet Witch I will test this later and give a tick if correct
21st Apr 2021, 8:12 AM
Codemurai
Codemurai - avatar