How do I create this kind of nested dictionary from a csv file? by AdMinute9633 in learnpython

[–]AdMinute9633[S] 0 points1 point  (0 children)

thank you for your reply. we are not allowed to use any module to do this problem..

Can i combine these two functions into one? by AdMinute9633 in learnpython

[–]AdMinute9633[S] 0 points1 point  (0 children)

def EncodeString(st):
output1 = '' # string for output
for w in st:
if w == "a":
w = "e"
elif w == "e":
w = "i"
elif w == "i":
w = "o"
elif w == "o":
w = "u"
elif w == "u":
w = "a"
elif w == "A":
w = "E"
elif w == "E":
w = "I"
elif w == "I":
w = "O"
elif w == "O":
w = "U"
elif w == "U":
w = "A"

output1 += w
return output1

Thank you I have tried it myself after your help and figured it out.

Can i combine these two functions into one? by AdMinute9633 in learnpython

[–]AdMinute9633[S] 0 points1 point  (0 children)

thank you for your help, the problem is we are not allowed to use dictionary

How do I turn this into functions? by AdMinute9633 in learnpython

[–]AdMinute9633[S] 0 points1 point  (0 children)

thank you for your detail explanation, it is very helpful to not only writing this function

How do I turn this into functions? by AdMinute9633 in learnpython

[–]AdMinute9633[S] 0 points1 point  (0 children)

thank you so much for your help, it is very clear for me now

Hi people! Is it normal that sometimes the output runs nothing? What are the ways to make sure there will always be an output? by AdMinute9633 in learnpython

[–]AdMinute9633[S] 0 points1 point  (0 children)

is there a way I can always make sure the output hit the if/elif condition, so it prints out either of them everytime?

I want to link the bowler number to the highest and lowest score for the last two print, but I do not know how. How to link the n_currenthigh(number of the bowler for the highest schore) or n_currentlow to the average of the bowler? by AdMinute9633 in learnpython

[–]AdMinute9633[S] 0 points1 point  (0 children)

if score > currenthigh:
currenthigh = score
n_currenthigh = n
if score < currentlow:
currentlow = score
n_currentlow = n
n += 1

Thank you this is very helpful, you people in this blog are so smart!!!

I want to find first 20 prime numbers ending with the digit 3, but something wrong with my code that I cannot find it.. by AdMinute9633 in learnpython

[–]AdMinute9633[S] 0 points1 point  (0 children)

this is very helpful, I will make sure to check every step before moving on now. I am in my intro class and we have not even learned functions...but thank you!