User Profile

Collapse

Profile Sidebar

Collapse
Azel Mr G
Azel Mr G
Last Activity: Nov 18 '10, 03:26 AM
Joined: Oct 28 '10
Location: Canada
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Hi bvdet

    The goal here is to accept input from the user and create a list. Then you will add the elements of the list to a set. If the set size increases, add the word to a dict with the word being a key and the value being the length of the set, which is also the number of
    pairs in the dict at the time it was added. In psuedocode, you will need something like:

    for each word in the input text:
    set...
    See more | Go to post

    Leave a comment:


  • Azel Mr G
    started a topic How to work with sets and dicts in Python?

    How to work with sets and dicts in Python?

    Hello Guys!
    I need to create a program similar to this explanation
    Code:
    for each word in the input text:
           set a variable equal to the length of the set
           add word to the set
           if the length of the set is greater than the length of the "old" set:
               add the word to the dict 
       for k, v in words.items():
           print(k, v)
    I am new to Python so for me it's very...
    See more | Go to post

  • I haven't seen ctr yet but I tried it and it worked.
    Thank you
    See more | Go to post

    Leave a comment:


  • Azel Mr G
    started a topic How to limit the amount of inputs(guesses)

    How to limit the amount of inputs(guesses)

    Hello guys and thank you in advance for reading my post.

    I am writing the following module which will ask the end-user to guess a number and after x amount of guesses a message should appear to says "Sorry, you have tried x times already"
    This is what I have so far.
    Code:
    n = 56
    
    while True:
            
        guess = int(input("Guess a number: "))
        if guess > n:
    ...
    See more | Go to post
No activity results to display
Show More
Working...