This Quiz is for beginners who are new to Python Programming. This quiz provides Multiple Choice Questions(MCQs) to get familiar with Python. The quiz focuses on testing your basic skills in Python functions, string, operators, functions, set, and lists.
The quiz contains 25 Questions. Solve 15 correct to pass the test.
I’m taking Python classes through CODEFINITY. They are completely lacking in any form of self evaluation or exercises. Looks like your site will help me fill in the gaps.. thanks
I toke the PY4E course by prof. Severance, which is a wonderfull course, but only thanks of this site I could be able to fully understand and practice the Python language and discover more.
Hi there! It’s great that you’re interested in learning programming. As an electronic hardware engineer, it’s normal to find some programming questions challenging at first, but with practice and dedication, you can gain a solid understanding.
Starting to learn programming might seem overwhelming, but I suggest starting with a language that aligns well with your goals. Depending on what you aim to achieve (embedded software development, automation, etc.), you might consider languages like Python, C, or even hardware-specific ones like Verilog or VHDL.
There are many online platforms, tutorials, and free resources available to help you learn programming. Additionally, practicing by solving coding problems and challenges can be very beneficial in improving your skills.
Don’t be discouraged by a few incorrect answers on an exam! Learning programming is an ongoing journey of discovery and practice. Keep going and best of luck with your learning!
heyyy i”m no good at python that much and i want to practice it just like a pro. will this help in my informatics practices preperation for 11th standard
Q2 so in this function we are simply multiplying two integar and printing the result but in case if the second value is not given then the default value would be 4 but in this case the value is given 6 so the default value wont be use and the answer would be ( 6 *5 = 30 ) but suppose the value of was’nt given then the default value 4 would be use and the answer would be ( 6 * 4 = 20 )
okay that was q6 not 2
so for question no 2
== means we are just comparing the value of different object
whereas is operator means we are saying that both the object belongs to the same memory location
since the variable are different so they will be given different memory locations
for example
a = 2
b= 2
so here we can say a ==b
but not a is b since both the variable are different and they are given different memory locations
Nope, the example you’ve given which is a = 2 b = 2. In that case both a == b and a is b will be true, since 2 is a constant and hence immutable, so python won’t create two different memory locations.
Var3 ek string hai aur var1 aur var2 integer hai aur in dono ko ek sath print karne ke liye inme se kisi ek ka type hame likhna hoga. tabhi ye print ho sakte hai.
it is a slicing operation …
syntax= str[start:stop:stepsize]
in this program string name pynative so take one array order box and write indexing values after
write indexing value 0 to start so in this program pynative y is a first character stop value is 3 so the
character is ‘a’.. the final answer is ‘yna’
I will not tell you my name for no reason because you may be able to attack me mentally or even locate where my school is so I am not telling you my name for absulutely no reason. Why do you even have this.says
Yes Sir, you did a very great job on this platform; The page is highly recommendable for learners and beginners who are learning or have learnt the basics of Python programming language but I have just one complaint. I’m sorry if this is a bit wrong to say but the comment made after a score is a bit discouraging. One of my co-learner did the quiz on her first go and got a 9 out of 18. The comment shown below it was(“Fail”) . Yes it was not a very good score but it felt a bit harsh and discouraging(so to say). I don’t know if I’m the only one who thinks that but maybe you should put a better comment. I don’t know. thank you
Yes, I felt the same way. I got 8 and it said ‘FAIL’ in big letters. Very discouraging and kind of hurtful as well, especially since I’ve spent hours trying to learn this and there was no positive feedback at all…
Was result supposed to say? YOU PASSED WITH FLYING COLORS!!!!! Congratulations!!!!
If you failed you failed that is not the end, the way to success is paved with much failure and only those that persevere find success.
Don’t be so sensitive, shake that dust off. I failed too, that tells me that I need to go and study and eventually I will get better.
Try again! It’s not the end of the world, there’s room to improve. But still, that does seem a bit harsh. Maybe it could say, “Oops! You did not gain a passing score. Try again!” Your co-learner probably did her best, so to say, so they should not go into her flaws, but rather appreciate what she did right.
<3–Jeju
I got 11 answers write and 7 wrong .
but I am happy because I am a biggner in this field.
Hey Vishal sir
can you give some advice in these days because sir I am biggner .
Please
the command is defined as[start:end:increment]
the index always starts with 0
James Bond
0123456789
Starting from index 2 = letter “m” no endpoint is defined but will decrease by -1 so the next letter is index 1 then 0 which relates in this case to : maJ
listone = [313131]
listtwo = [313131]
listone == listtwo #listone can be equal to listtwo because they have the same values
listone is listtwo # this tells us whether the objects are the same or not. In this case, they are not, because they have different names. Thus we get False in the second operation but True in the first one.
print(str[startvalue:endvalue]) this is the syntax and the first index of pynative is y because index value always starts with 0 . The end value given is (index) 3 which is a and the last value must not be (included that is syntax) so the output is yn..
As the index get started from 0…the 1st indexed element is y and up to index 3..here we have to take value up to index 2 and 3 is our Boundary. so answer
is “yn”
As a complete beginner who just learned python for a few days, I find this quiz great. After submitting the answers, it doesn’t just give you the correct answers, but also the explanation behind the answers. It’s very informative for beginners. Thanks for the quiz! Btw I only got 6 right lol
There’s an error on “Basic Python Quiz For Beginners” on Question 18, var1 and then in the print statement it isn’t spelt the same way, It’s a little bit misleading
Hi. I really appreciate the help you do for beginners and if it’s ok can you please let me know the answer to this?
“Write some Python code that defines a function called print_header(msg). This should output the value provided by the ‘msg’ parameter to the screen (prefixed by five asterisk ‘*****’) characters”
In question #17 I checked false, because the in operator checks for the value, not for the variable (whatever that means). I think the wording could be improved in that one.
Just a couple of points. Question 13 – you have “var” instead of “var1” in the print line and so the error message is probably going to be that “var” is not defined, rather than the correct selection. Question 17 has exponentiation as the highest precedence. This does not agree with the python documentation https://docs.python.org/3/reference/expressions.html#id22 which would indicate that the comparison operator has the highest precedence.
This quiz was really helpful to me as I was thinking to learn advanced Python but I was not sure that I know the basics well. Also, can you suggest where should I learn advanced Python and is Python Django will be too advanced right after the basics?
Create a Python program (using any of the selection structures) that will accept distance in kilometer/s as input, and student or elderly passengers will pay the discounted rate, disabled passengers will get an additional 10% discount with the original discounted rate, otherwise the regular fare will be used as basis for the computation of fare. The output will be the total fare for the passenger.
Excellent job , I am a teacher and teach class XI and XII and as per the new syllabus of CBSE for computer science and IP we are teaching the same topics and your website is being very helpful. I also request you suggest some very good projects for these 17 year olds.
This was amazing and helpful for beginers
It was good
very good quiz questions! essential as hell!!
its my day 2 learning python and i got 9/18. Some questions here are lessons i havent encountered yet but im happy i got half
hi this is my first days i have completed Python Basic Quiz for Beginners.
You scored 17 points out of 18 points in total.
ITS NOT YOU IT WILL BECOME I BECAUSE YOU WILL BECOME SECOND PERSON PLURAL. I WILL BECOME 1ST PERSON SINGULAR I WILL COME THERE.
It´s my first day learning Python and I scored 20 out of 18. Yeah!
Thank you so much sir its so improving test
I’m taking Python classes through CODEFINITY. They are completely lacking in any form of self evaluation or exercises. Looks like your site will help me fill in the gaps.. thanks
I toke the PY4E course by prof. Severance, which is a wonderfull course, but only thanks of this site I could be able to fully understand and practice the Python language and discover more.
So, really thank you Vishal for all of this!
Im electronic hardware engineer and i find these hard to answer which got me 10 out of 18..i want to learn programming, any advice?
Sure, here’s a translation:
Hi there! It’s great that you’re interested in learning programming. As an electronic hardware engineer, it’s normal to find some programming questions challenging at first, but with practice and dedication, you can gain a solid understanding.
Starting to learn programming might seem overwhelming, but I suggest starting with a language that aligns well with your goals. Depending on what you aim to achieve (embedded software development, automation, etc.), you might consider languages like Python, C, or even hardware-specific ones like Verilog or VHDL.
There are many online platforms, tutorials, and free resources available to help you learn programming. Additionally, practicing by solving coding problems and challenges can be very beneficial in improving your skills.
Don’t be discouraged by a few incorrect answers on an exam! Learning programming is an ongoing journey of discovery and practice. Keep going and best of luck with your learning!
heyyy i”m no good at python that much and i want to practice it just like a pro. will this help in my informatics practices preperation for 11th standard
Awesome website. I was just looking for an OOP courses and decided to take this quiz, I got 15/18. The feedback is very helpful. Let’s learn OOP now.
I suggest that you should rewrite the questions so that they follow Python naming conventions; all entities should be named in lowercase.
Example the function printSalary() should be named as printsalary() or print_salary()
But thank you for the helpful learning resource.
I scored 14/18
my score 17 out of 18
my score was15/18
Are you studying in BTech cs
it is very useful
yeah bro
This was nice, I understand what I need to work on.
Thanks for creating this website.
Sorry Can you plzz explain Q2, Q6 , Q10
It’ after the words
Explanation
For #10, the index starts at zero. So if it starts at 1 and we exclude (3), it would be yn.
Q2 so in this function we are simply multiplying two integar and printing the result but in case if the second value is not given then the default value would be 4 but in this case the value is given 6 so the default value wont be use and the answer would be ( 6 *5 = 30 ) but suppose the value of was’nt given then the default value 4 would be use and the answer would be ( 6 * 4 = 20 )
hope that was helpful thanking you
lakhan sharan
okay that was q6 not 2
so for question no 2
== means we are just comparing the value of different object
whereas is operator means we are saying that both the object belongs to the same memory location
since the variable are different so they will be given different memory locations
for example
a = 2
b= 2
so here we can say a ==b
but not a is b since both the variable are different and they are given different memory locations
Nope, the example you’ve given which is a = 2 b = 2. In that case both a == b and a is b will be true, since 2 is a constant and hence immutable, so python won’t create two different memory locations.
can you plzz explain Q9.
Yes ofcourse
Var3 ek string hai aur var1 aur var2 integer hai aur in dono ko ek sath print karne ke liye inme se kisi ek ka type hame likhna hoga. tabhi ye print ho sakte hai.
I’m still confused why the else passes in “8. Can we use the “else” block for for loop?”.
I thought that if the for loop was successfull, it would break and not pass the else loop. I thought the else loop was for if the for loop failed?
But it will successfully run the for loop AND print the else loop?
Its just asking if you are allowed to add the else condition inside of a for statement, which is true, hence the answer. Confused me at first too!
Q8 please
str = "pynative"
print (str[1:3])
it is a slicing operation …
syntax=
str[start:stop:stepsize]
in this program string name pynative so take one array order box and write indexing values after
write indexing value 0 to start so in this program pynative y is a first character stop value is 3 so the
character is ‘a’.. the final answer is ‘yna’
you are wrong
the final answer will be ‘yn’
agree
Yes Sir, you did a very great job on this platform; The page is highly recommendable for learners and beginners who are learning or have learnt the basics of Python programming language but I have just one complaint. I’m sorry if this is a bit wrong to say but the comment made after a score is a bit discouraging. One of my co-learner did the quiz on her first go and got a 9 out of 18. The comment shown below it was(“Fail”) . Yes it was not a very good score but it felt a bit harsh and discouraging(so to say). I don’t know if I’m the only one who thinks that but maybe you should put a better comment. I don’t know. thank you
Do better
Yes, I felt the same way. I got 8 and it said ‘FAIL’ in big letters. Very discouraging and kind of hurtful as well, especially since I’ve spent hours trying to learn this and there was no positive feedback at all…
Was result supposed to say? YOU PASSED WITH FLYING COLORS!!!!! Congratulations!!!!
If you failed you failed that is not the end, the way to success is paved with much failure and only those that persevere find success.
Don’t be so sensitive, shake that dust off. I failed too, that tells me that I need to go and study and eventually I will get better.
That is very well said.
Try again! It’s not the end of the world, there’s room to improve. But still, that does seem a bit harsh. Maybe it could say, “Oops! You did not gain a passing score. Try again!” Your co-learner probably did her best, so to say, so they should not go into her flaws, but rather appreciate what she did right.
<3–Jeju
this was very useful and fun!
Hi sir I want to prepare python coding job this is very helpful bt how to prepare interview I don’t that plzzz tel me sir
I got 11 answers write and 7 wrong .
but I am happy because I am a biggner in this field.
Hey Vishal sir
can you give some advice in these days because sir I am biggner .
Please
same
If you are a beginner then first try to study about theoretical part little bit not much more and then go with practical part.
Secondly, create or write code everyday little bit harder than previous one.
Yes, I am 11 too, and I got 16/18. Great job tho.
Got 15 right and 3 wrong answer..
But refreshed. Amazing website.
I got 17/ 18 upon my trial though am a beginner
I got 16/18.
Perfect for the self taught who are trying to learn coding without the benefit of quizzes, of which help me tremendously.
Please, anyone, explain to me problem no.16
in Python you can use the in operator to check if a value is in a list for example:
the command is defined as
[start:end:increment]
the index always starts with 0
Starting from index 2 = letter “m” no endpoint is defined but will decrease by -1 so the next letter is index 1 then 0 which relates in this case to : maJ
I got 24 out of 25
listone = [313131]
listtwo = [313131]
listone == listtwo #listone can be equal to listtwo because they have the same values
listone is listtwo # this tells us whether the objects are the same or not. In this case, they are not, because they have different names. Thus we get False in the second operation but True in the first one.
print(str[startvalue:endvalue])
this is the syntax and the first index of pynative is y because index value always starts with 0 . The end value given is (index) 3 which is a and the last value must not be (included that is syntax) so the output is yn..I just completed my first run, I got an 8 score, this is an amazing test and learned a few new things after reading the correct answers
I completed my first exam and I got 8 marks out of 18
Good
Great
good well
agreed
Good for skill development
Fun quiz; it gives one a good idea of what is really fully understood and which subtleties need be reviewed to enhance the overall understanding.
thanks it’s q good refresh for information, also i found new one.
thank you so much for this website and that too for free ! I GENUINELY APPRECIATE THIS MAN
i love you thanks for another resource to help me learn !
Really it’s benificial..
Thanks Vishal. Your explanation is very clear and understandable.
You did an awesome job.
good job
Hi
I am not able to understand the Explanation of Q.no 2
can any help me out.
Question 2
As the index get started from 0…the 1st indexed element is y and up to index 3..here we have to take value up to index 2 and 3 is our Boundary. so answer
is “yn”
Yes. You Are Right
yup
it should be an integers number, at the place of integers
As a complete beginner who just learned python for a few days, I find this quiz great. After submitting the answers, it doesn’t just give you the correct answers, but also the explanation behind the answers. It’s very informative for beginners. Thanks for the quiz! Btw I only got 6 right lol
Thanks lot, its really superb idea to learn asap. liked it
being tested helps me learn and remember way better than reading stuff or watching hours of Udemy videos – thank you so much!!
It’s good
you did very well for beginners and specially thanks
There’s an error on “Basic Python Quiz For Beginners” on Question 18, var1 and then in the print statement it isn’t spelt the same way, It’s a little bit misleading
Share my details on mail
It’s great! Thank you.
18.) I assume
Doesn’t matter since the expression itself will fail with an error…
Hi. I really appreciate the help you do for beginners and if it’s ok can you please let me know the answer to this?
“Write some Python code that defines a function called print_header(msg). This should output the value provided by the ‘msg’ parameter to the screen (prefixed by five asterisk ‘*****’) characters”
def print_header(msg):
print("*****",msg)
msg=input("enter msg:")
print_header(msg)
thanks for creating this
I can no longer have access to the quizz answers though i tried on different PCs.
I wonder why?
Hey Saif, The Issue is reloved now. Sorry for the inconvenience.
Q15 please explain
it will print “yn” as indexing start from 0 and [1:3] mean including 1 index and exclude 3 index so it will print 1 and 2 index value which is “yn”
Thank you,
The lessons are very-very important and useful
Thank you sir
A wonderful and useful site for python basics!
It’s was good. Helpful to me to understand better. Thanks for this quiz
Excellent job sir.
This is very nice job we practised a lot and if possible keep more quiz’s with this you might help more learners.
this doesnt even let you see your score or what your missed/got right
In question #17 I checked false, because the in operator checks for the value, not for the variable (whatever that means). I think the wording could be improved in that one.
Just a couple of points. Question 13 – you have “var” instead of “var1” in the print line and so the error message is probably going to be that “var” is not defined, rather than the correct selection. Question 17 has exponentiation as the highest precedence. This does not agree with the python documentation https://docs.python.org/3/reference/expressions.html#id22 which would indicate that the comparison operator has the highest precedence.
Thank you very much
Thank you for his quiz, it was very helpful!
You are welcome.
This is such a helpful website. It is totally user-oriented and it shows. Great work.
Thank you, Aakarsh for your kind words.
Hi! can you help me with coding?
You are doing amazing. I really liked it.
Thank you Vishal Sir.It really helpful for beginners.It me help the more about what is python .Thank u sir.
Great resource. Thank you Vishal. Good work. Really helpful for beginners
Thank you, Dovran
Thank you so much , It helps me to know more about the python
You are welcome, Abhiram.
In Question 11 the result of the first division is a float, hence the output is 182.0 rather than 182
Thank you for letting me know I have updated the question.
Question 17 has a problem,index -1 belongs to d yet the answer suggests that J has the index of -1
No. You can try by executing the code. the given answer is correct.
This is very useful for me as a beginner, thank you! ❤
This question uses
/
operator which always gives you floating value.I am gonna challenge u for googles code jam join me and lose hahahahah !
I just scored 16 points and it failed me ??????
but it’s a good website indeed
Thanks Vishal. This is a very useful page. Appreciate it.
Keep up the good work !
Thank you
Excellent Python quiz with concise explanations of the correct answers. A great learning tool
Thank you, Marvis.
Question number two had a semicolon. Unless I’m really missing something here that would have caused an error.
Hey Ryan, Thank you. I have updated a question
This quiz was really helpful to me as I was thinking to learn advanced Python but I was not sure that I know the basics well. Also, can you suggest where should I learn advanced Python and is Python Django will be too advanced right after the basics?
It depends on your work and interest. I suggest you practice data structure and then move as per your work need and interest.
Actually I don’t have any work needs because I’m still in school but thanks for the advice. 🙂
one request,if you can add some code in that we have to find a error so that logic will develop.
Hey kavya Maheshwari, I will add that.
Can you help me
Create a Python program (using any of the selection structures) that will accept distance in kilometer/s as input, and student or elderly passengers will pay the discounted rate, disabled passengers will get an additional 10% discount with the original discounted rate, otherwise the regular fare will be used as basis for the computation of fare. The output will be the total fare for the passenger.
thank you for these tests they help a lot
Thank you, Sean De Villiers
Where are the answers to the above questions?
Sorry Md Golam Rabbani, There was CSS error. I have solved that. Now you can see the answers.
I want answer sir plz
Hi, After quiz submission, scroll the page to view the result and correct answers.
How can I see the answer to the above questions?
Excellent job , I am a teacher and teach class XI and XII and as per the new syllabus of CBSE for computer science and IP we are teaching the same topics and your website is being very helpful. I also request you suggest some very good projects for these 17 year olds.
Thank you sir,
It will help me to test my self And learn more about basics
very good teacher