Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Hier unten seht Ihr viermal die gleiche Ausgabe. Es gibt vier verschiedene Möglichkeiten, diese Ausgabe hinzukriegen.")
- # Difficult?
- string_dictionary = {
- 1: " +1. open+: +1",
- 2: " +2. high+: +1",
- 3: " +3. low+: +1",
- 4: " +4. close+: +1",
- 5: " +5. volume+: +5"
- }
- for i in range(1,6):
- print(len(string_dictionary[i]))
- # More difficult? (Entries in a dictionary, string + integer variables.)
- print("--------")
- string_dictionary = {
- "x1": " +1. open+: +1",
- "x2": " +2. high+: +1",
- "x3": " +3. low+: +1",
- "x4": " +4. close+: +1",
- "x5": " +5. volume+: +5"
- }
- for i in range(1,6):
- print(len(string_dictionary["x" + str(i)]))
- print("--------")
- string_dictionary = {
- "x1": " +1. open+: +1",
- "x2": " +2. high+: +1",
- "x3": " +3. low+: +1",
- "x4": " +4. close+: +1",
- "x5": " +5. volume+: +5"
- }
- for key in string_dictionary:
- print(len(string_dictionary[key]))
- print("--------")
- # Insanely difficult? (Just the variables outside of a dictionary.)
- x1 = " +1. open+: +1",
- x2 = " +2. high+: +1",
- x3 = " +3. low+: +1",
- x4 = " +4. close+: +1",
- x5 = " +5. volume+: +5"
- for i in range(1,6):
- print(len(xi))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement