[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Guy Learning Python Here could used some advice

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 7
Thread images: 1

File: 1467078063780.png (78KB, 282x300px) Image search: [Google]
1467078063780.png
78KB, 282x300px
Learning Python 3.5 keep fucking this quiz I'm trying to make
https://github.com/SleepOwl/test-quiz-application/issues/2

Count Vowels Function Iwant to make this function operate from the rest
If the random number is 2, ask the user “How many vowels does the word contain?” and prompt user for input. Assess their answer, and then print an appropriate message.

def vowelcount(word):
correct = word_map[word]['vowels']
ans = input('How many vowels does "{}" contain?'.format(word))
return check(int(ans), correct)

is they are a way to place it's out into the def start_test

I normally wouldn't ask but it's giving me the shits
>>
The code in correct formatting is attached at that link location in a text file.
>>
>>56405403
This is the worst possible place to ask and your ESL is showing. Just define your function outside of 'start_test' and call it from within 'start_test'.

def vowelcount(word):
...

def start_test(number_questions):
...
>>
>>56405540
how would I call it and sorry I'm super new at this and I'm sorry for my grammar I'm running on a tiny amount of sleep right now
>>
>>56405742
>not knowing how to call a function
Please fuck off.
>>
>>56405742
def add(a, b):
return a + b

c = add(5, 7)
print c


>>56405806
He's a novice and he's on the right track. These are the same programs everyone writes when they start out.
>>
>>56405832
>thanks

I just thought there might be a difference when you normally do it that's all. I made that the rest of that myself.
Thread posts: 7
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.