<jupyter_start><jupyter_text>Challenge 035Ask the user to enter their name and then display their name three times.<jupyter_code>name = input("Enter your name : ")

for i in range(3) : 
    print(name)<jupyter_output><empty_output><jupyter_text>Challenge 036Alter program 035 so that it will ask the user to enter their name and a number and then display their name that number of times.<jupyter_code>name = input("Enter your name : ")
num = int(input("Enter a number : "))

for i in range(num) : 
    print(name)<jupyter_output><empty_output><jupyter_text>Challenge 037Ask the user to enter their name and display each letter in their name on a separate line.<jupyter_code>name = input("Enter your name : ")

for letter in name : 
    print(letter)<jupyter_output><empty_output><jupyter_text>Challenge 038Change program 037 to also ask for a number. Display their name (one letter at a time on each line) and repeat this for the number of times they entered.<jupyter_code>name = input("Enter your name : ")
num = int(input("Enter a number : "))

for i in range(num) : 
    for letter in name : 
        print(letter)<jupyter_output><empty_output><jupyter_text>Challenge 039Ask the user to enter a number between 1 and 12 and then display the times table for that number.<jupyter_code>num = int(input("Enter a number : "))

print("Multiplication table of {}".format(num))

for i in range(1,11) :
    print("{} * {} = {}".format(num, i, num*i))<jupyter_output><empty_output><jupyter_text>Challenge 040Ask for a number below 50 and then count down from 50 to that number, making sure you show the number they entered in the output.<jupyter_code>num = int(input("Enter a number (below 50) : "))

for i in range(50, num-1, -1) : 
    print(i)<jupyter_output><empty_output><jupyter_text>Challenge 041Ask the user to enter their name and a number. If the number is less than 10, then display their name that number of times; otherwise display the message “Too high” three times.<jupyter_code>name = input("Enter your name : ")
num = int(input("Enter a number : "))

if num < 10 :
    for i in range(num) : 
        print(name)

else :
    for i in range(3) : 
        print("Too High")<jupyter_output><empty_output><jupyter_text>Challenge 042Set a variable called total to 0. Ask the user to enter five numbers and after each input ask them if they want that number included. If they do, then add the number to the total. If they do not want it included, don’t add it to the total. After they have entered all five numbers, display the total.<jupyter_code>total = 0

print("Enter five numbers : ")

for i in range(5) : 
    num = int(input("Enter number {} : ".format(i+1)))
    
    choice = input("Do you want this number included in total? y/n : ")

    if choice == 'y' :
        total += num
    
    else : 
        continue

print("The total of included numbers is {}.".format(total))<jupyter_output><empty_output><jupyter_text>Challenge 043Ask which direction the user wants to count (up or down). If they select up, then ask them for the top number and then count from 1 to that number. If they select down, ask them to enter a number below 20 and then count down from 20 to that number. If they entered something other than up or down, display the message “I don’t understand”.<jupyter_code>count_dir = input("In which direction do you want to count? up/down : ")

if count_dir == 'up' :
    top = int(input("Enter a number : "))
    for num in range(1, top+1) : 
        print(num)

elif count_dir == 'down' :
    bottom  = int(input("Enter a number (below 20) : "))
    for num in range(20, bottom-1, -1) :
        print(num)

else : 
    print("I don't understand.")<jupyter_output><empty_output><jupyter_text>Challenge 044Ask how many people the user wants to invite to a party. If they enter a number below 10, ask for the names and after each name display “[name] has been invited”. If they enter a number which is 10 or higher, display the message “Too many people”.<jupyter_code>no_of_invites = int(input("How many people do you want to invite to the party? : "))

if no_of_invites < 10 :
    for i in range(no_of_invites) :
        invitee = input("Who do you want to invite? Enter name : ")
        print("{} has been invited.".format(invitee))
    
else :
    print("Too many people.")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09722863741339492, 'fraction_numerical': 0.018706697459584296, 'mean_word_length': 4.030197444831591, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '239434', 'license': 'MIT', 'n_tokens_mistral': 1415, 'n_tokens_neox': 1321, 'n_words': 547, 'path': 'python by examples - solutions/05. for loop.ipynb', 'repo_name': 'ranjankoirala1998/python', 'size': '4330'}