Wednesday, April 16, 2014

Python Developer Interview Questions: Fizz-Buzz

Fizz-buzz is a very basic interview question mainly asked to see if a developer/programmer can actually code or not. Nothing too sophisticated.I was asked to code a FizzBuzz today for the second time in my life and I thought why not to blog about it, since it seems to be getting popular to ask from developers. To make it a bit challenging for myself, I coded it in Python, since I have the least skill in coding Python, although I think it is a sexy language.

Interview Question: Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”."

Solution:
```__author__ = 'amir'

for x in range(1, 100):
if x % 15 == 0:
print 'fizzbuzz'
elif x % 3 == 0:
print 'fizz'
elif x % 5 == 0:
print 'buzz'
else:
print x
```

Remark: Just remember that a number that is both divisible by three and five is also divisible by 15. Another note is that you need to check if the divisible by 15 condition first of all, if not they end up in divisible by 3 and 5 condition. Makes sense, right? :)

1. This blog awesome and i learn a lot about programming from here.The best thing about this blog is that you doing from beginning to experts level.

Love from

2. Wow. This really made my day. Thanks a lot!
JQuery Training JQuery Training Javascript JQuery Online Training

JQuery Online Training JQuery Online Training Javascript Online Training JQuery Training

JavaScript Training Courses

3. Such a great articles in my carrier, It's wonderful commands like easiest understand words of knowledge in information's.
Python Training in Chennai

4. Thank you very much, nice article to learn and it gives clear picture.
Java Script training in chennai

5. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
Android Training in Chennai
Ios Training in Chennai

6. Python Training in Chennai with real-time corporate professionals. We are providing practical oriented best python training institute in Bangalore. Python Training in Bangalore |
Pearson Vue Exam Center in Bangalore

7. Thanks for one marvelous posting! I enjoyed reading it; you are a great author. Besant technology provides python course training in chennai

8. Thanks For wonderful Blog
Devops training in Bangalore

9. I simply wanted to thank you so much again. I am not sure the things that I might have gone through without the type of hints revealed by you regarding that situation.

Java Training in Bangalore|

10. It’s always so sweet and also full of a lot of fun for me personally and my office colleagues to search your blog a minimum of thrice in a week to see the new guidance you have got.

Selenium Training in Bangalore

11. Thanks for one marvelous posting! I enjoyed reading it; you are a great author. I will make sure to bookmark your blog and may come back someday. I want to encourage that you continue your great posts, have a nice weekend!
DevOps Training in Bangalore

12. Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support about this area.

13. Day by day I am getting new things and learn new concept through your blogs, I am feeling so confidants, and thanks for your informative blog keep your post as updated one... AWS Training in Bangalore

14. Very Nice Blog on Python Developer Interview Questions,
Thank you for sharing kindly keep writing more about Python
Thank you once again.
Devops Training in Bangalore

15. This comment has been removed by the author.

16. This comment has been removed by the author.

Python Online Training

ServiceNow Online Training

mulesoft Online Training

19. very niceblog it was useful

20. very nice blog It was useful

21. This information is informative. Thanks for taking time to discuss this. QA Training Hub is best Python Programing Online Training Center in India. Python Online Training provided by real time working Professional Mr. Dinesh. Data Scientist and RPA Expert with 18+ years of industry experience in teaching Python. Best Python Online Training Contact: Mr. Dinesh Raju : India: +91-8977262627, USA: : +1-845-493-5018, Mail: info@qatraininghub.com

22. the blog is about Python Developer Interview #Python it is useful for students and Python Developers for more updates on python follow the link

Python Online Training Bangalore

ServiceNow Online Training

mulesoft Online Training

would love to read it more
devops online training
Devops Training in Bangalore

24. thank you for giving sollution Python Online Training

25. Your blog was very interesting & easy to understand. Thank you so much sharing that valuable blog.. Internal Audit | Vendor Reconciliation | Fixed Assets Audit

26. Those guidelines additionally worked to become a good way to recognize that other people online have the identical fervor like mine to grasp great deal more around this condition.

Selenium Training in Chennai

Aws Training in Chennai

27. Hi Man,

I love all the posts, I really enjoyed.

First off I'm not a strong Python developer. I'm a Network Engineer and I use Python to create automation scripts for accessing routers and switches. I've never tried to convert a script of any type. A coworker asked me to help him convert a Perl script to Python. In my research and findings, I'm having some issues trying to find what I need in Python or even making it work.

The Perl script accesses Cisco's Call Manager (phone system) webpage (https, authenication, ignore SSL), it pulls data off the pages, may be more than one with up to 2000 line items on each page. It then parses it (XML) into two columns, userID and extensions, and dumps it into a .CSV file. It then reads that .CSV file, accesses Microsoft Active Directory, looks up the userID and puts the extension of that userID into the persons Active Directory profile under the ipPhone attribute.

The modules the Perl script uses are below vs what I've been trying to use in Python3...

Net::LDAP; = python3-ldap3
LWP::UserAgent; = urllib3
LWP::Protocol::https; = requests
XML::Simple; = lxml

Any help would be appreciated. I'd like to know if I'm using the right equivalents of Python3 and any great examples on how to use these modules.

So far,
just even getting
Python3 to "get" the URL, pass authentication credentials on the website and to ignore SSL cert has been really hard and frustrating. I'm not getting anywhere with that.

THANK YOU!! This saved my butt today, I’m immensely grateful.

Ajeeth kapoor

28. Nice blog. Thank you for sharing. The information you shared is very effective for learners I have got some important suggestions from it. Duplicate Payment Review | Continuous Transaction Monitoring | Duplicate Payment Recovery

29. Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support about this area.

https://www.besanttechnologies.com/robotic-process-automation-rpa-training-in-bangalore

30. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
Python Training in Bangalore

31. And indeed, I’m just always astounded concerning the remarkable things served by you. Some four facts on this page are undeniably the most effective I’ve had. Best AWS Training in Bangalore

32. Those guidelines additionally worked to become a good way to recognize that other people online have the identical fervor like mine to grasp great deal more around this condition.

Best AWS training in bangalore

33. Nice blog thank you for sharing it is very useful python Online Training Bangalore

34. Hi Your Blog is very nice!!

Get All Top Interview Questions and answers PHP, Magento, laravel,Java, Dot Net, Database, Sql, Mysql, Oracle, Angularjs, Vue Js, Express js, React Js,
Hadoop, Apache spark, Apache Scala, Tensorflow.

Mysql Interview Questions for Experienced
php interview questions for freshers
php interview questions for experienced
python interview questions for freshers

35. This comment has been removed by the author.

36. nice post thank you for sharing useful information

37. It's A Great Pleasure reading your Article, learned a lot of new things, we have to keep on updating it Mulesoft certification training Thanks for posting.

38. This is a very helpful blog. would recommend it to everyone dabbling in Python.python training in Chennai

39. Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.
java training in omr

java training in annanagar | java training in chennai

java training in marathahalli | java training in btm layout

java training in rajaji nagar | java training in jayanagar

40. Really very nice blog information for this one and more technical skills are improve,i like that kind of post.
java training in chennai | java training in bangalore

java online training | java training in pune

java training in chennai | java training in bangalore

41. This blog is the general information for the feature. You got a good work for these blog.We have a developing our creative content of this mind.Thank you for this blog. This for very interesting and useful.
python training in chennai | python training in bangalore

python online training | python training in pune

python training in chennai | python training in bangalore

42. Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information..

rpa training in Chennai

rpa training in anna nagar | rpa training in marathahalli

rpa training in btm | rpa training in kalyan nagar

rpa training in electronic city | rpa training in chennai

rpa online training | selenium training in training

43. Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information..

rpa training in Chennai

rpa training in anna nagar | rpa training in marathahalli

rpa training in btm | rpa training in kalyan nagar

rpa training in electronic city | rpa training in chennai

rpa online training | selenium training in training

44. A very nice guide. I will definitely follow these tips. Thank you for sharing such detailed article. I am learning a lot from you.

Data Science Training in Chennai
Data science training in bangalore
Data science online training
Data science training in pune
Data science training in kalyan nagar
selenium training in chennai

45. Thank you very much for your post.Its pretty interesting. I appreciate your blogs and look forward for your next blog.

46. Python is a high-level, interpreted, interactive and object-oriented scripting language. Python is designed to be highly readable. It uses English keywords frequently where as other languages use punctuation, and it h
as fewer syntactical constructions than other languages.

47. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
python online training
python training in OMR
python training in tambaram

48. Excellant post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
python training in tambaram
python training in annanagar
python training in jayanagar

49. Thanks for your informative article, Your post helped me to understand the future and career prospects & Keep on updating your blog with such awesome article.
Devops training in sholinganallur
Devops training in velachery

50. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
DevOps online Training

51. Hmm, it seems like your site ate my first comment (it was extremely long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog. I as well as an aspiring blog writer, but I’m still new to the whole thing. Do you have any recommendations for newbie blog writers? I’d appreciate it.

Best Selenium Training in Chennai | Selenium Training Institute in Chennai | Besant Technologies

Selenium Training in Bangalore | Best Selenium Training in Bangalore

AWS Training in Bangalore | Amazon Web Services Training in Bangalore

52. Whoa! I’m enjoying the template/theme of this website. It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between superb usability and visual appeal. I must say you’ve done a very good job with this.

AWS Online Training | Online AWS Certification Course - Gangboard

Best Selenium Training in Chennai | Selenium Training Institute in Chennai | Besant Technologies

Selenium Training in Bangalore | Best Selenium Training in Bangalore

AWS Training in Bangalore | Amazon Web Services Training in Bangalore

Amazon Web Services Training in Pune | Best AWS Training in Pune

53. Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.
iosh course in chennai

54. This is a nice article here with some useful tips for those who are not used-to comment that frequently. Thanks for this helpful information I agree with all points you have given to us. I will follow all of them.
Data Science Training in Indira nagar | Data Science Training in btm layout

Python Training in Kalyan nagar | Data Science training in Indira nagar

Data Science Training in Marathahalli | Data Science training in Bangalore | Data Science Training in BTM Layout | Data Science training in Bangalore

55. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
Online DevOps Certification Course - Gangboard
Best Devops Training institute in Chennai

56. Really very nice blog information for this one and more technical skills are improve,i like that kind of post.
excel advanced excel training in bangalore | Devops Training in Chennai

57. Wonderful bloggers like yourself who would positively reply encouraged me to be more open and engaging in commenting.So know it's helpful.
python interview questions and answers | python tutorialspython course institute in electronic city

58. This is most informative and also this post most user friendly and super navigation to all posts... Thank you so much for giving this information to me..

best rpa training in chennai |
rpa training in chennai | rpa online training |
rpa training in chennai |
rpa training in bangalore
rpa training in pune
rpa training in marathahalli
rpa training in btm

59. Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information.

rpa training in chennai |
best rpa training in chennai
rpa online training
rpa course in bangalore
rpa training in pune
rpa training in marathahalli
rpa training in btm

60. We are a group of volunteers and starting a new initiative in a community. Your blog provided us valuable information to work on.You have done a marvellous job!

python interview questions and answers | python tutorialspython course institute in electronic city

61. This is most informative and also this post most user friendly and super navigation to all posts... Thank you so much for giving this information to me.

best rpa training in chennai
rpa training in chennai |
rpa online training
rpa course in bangalore
rpa training in pune

62. Thank you for taking the time to provide us with your valuable information. We strive to provide our candidates with excellent care and we take your comments to heart.As always, we appreciate your confidence and trust in us
Java training in Bangalore |Java training in Rajaji nagar

Java training in Bangalore | Java training in Kalyan nagar

Java training in Bangalore | Java training in Kalyan nagar

Java training in Bangalore | Java training in Jaya nagar

63. I am really happy with your blog because your article is very unique and powerful for new reader.
selenium training in chennai
selenium training in bangalore
selenium training in Pune
selenium training in pune
Selenium Online Training

64. Hii…It was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly. The Post is a Wonderful Opportunity for Beginners of Python Course. Take time To look at our Website.

65. Nice post, Thanks for sharing this with us.This information is very useful for the interview.For more information.
aws online training
amazon web services(AWS) online training

66. Whoa! I’m enjoying the template/theme of this website. It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between superb usability and visual appeal. I must say you’ve done a very good job with this.

Oracle Training in Chennai | Best Oracle Training Institute in Chennai
Web Design Training in Chennai
Web Design Training in Chennai|Best Web Design Training in Chennai
AngularJS Training in Chennai |Advanced SAS Training in Chennai | Best SAS Training in Chennai

67. Hmm, it seems like your site ate my first comment (it was extremely long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog. I as well as an aspiring blog writer, but I’m still new to the whole thing. Do you have any recommendations for newbie blog writers? I’d appreciate it.

AWS Training in Bangalore | Amazon Web Services Training in bangalore , india

AWS Training in pune | Amazon Web Services Training in Pune, india

AWS Training in Chennai|Amazon Web Services Training in Chennai,India

aws online training and certification | amazon web services online training ,india

68. Thank you. Your blog was very helpful and useful For Me,Thanks for Sharing Best Python Online Training || Learn Python Course

69. This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
aws Training in indira nagar | Aws course in indira Nagar

selenium Training in indira nagar | Best selenium course in indira Nagar | selenium course in indira Nagar

python Training in indira nagar | Best python training in indira Nagar

datascience Training in indira nagar | Data science course in indira Nagar

devops Training in indira nagar | Best devops course in indira Nagar

70. I’m thoroughly enjoying your blog. I as well as an aspiring blog writer, but I’m still new to the whole thing.
nebosh course in chennai

71. i am really reading in your well written article .It took like you Spend a lot of effort and time on your blog .Thank u For sharing .

72. A small number of my blog audience have complained about my site not working correctly in Explorer but looks great in Safari. Do you have any ideas to help fix this problem?
nebosh igc courses in chennai

73. Great information. Thanks for sharing.
Interview Guidance

74. Currently Python is the most popular Language in IT. Python adopted as a language of choice for almost all the domain in IT including Web Development, Cloud Computing (AWS, OpenStack, VMware, Google Cloud, etc.. ),Read More

75. Hi! The post you published is well-written and informative. It has more topic discussions which i want really. So helpful to me. Keep updating.
Pyhton Training in Chennai
Python Course in Chennai
AWS Training in Chennai
CCNA Training in Chennai
German Language Course in Chennai
German Courses in Chennai

76. You have posted a worthy blog keep sharing. Nice article I was really impressed by seeing this article, it was very interesting and it is very useful for me.

IELTS Coaching in Tambaram
IELTS Training in Tambaram East
IELTS Training Institute in Guduvanchery
IELTS Coaching in Velachery
IELTS Coaching Centre in Velachery
IELTS Coaching Centre in Guindy
IELTS Training in Velachery

77. Nice blog..! I really loved reading through this article... Thanks for sharing such an amazing post with us and keep blogging...
python online training
Best python online training
python online training in india

78. Thanks For Sharing The Information The Information shared Is Very Valuable Please Keep Updating Us Time Just Went On reading The Article Python Online Training Aws Online Course DataScience Online Course Devops Online Course

79. Hey, would you mind if I share your blog with my twitter group? There’s a lot of folks that I think would enjoy your content. Please let me know. Thank you.
AWS Training in Chennai
Data Science Training in Chennai
Python Training in Chennai

80. Really great post, I simply unearthed your site and needed to say that I have truly appreciated perusing your blog entries.
devops online training

aws online training

data science with python online training

data science online training

rpa online training

81. Really great post, Thank you for sharing This knowledge.Excellently written article, if only all bloggers offered the same level of content as you, the internet would be a much better place. Please keep it up!
Microsoft Azure online training
Selenium online training
Java online training
uipath online training
Python online training

82. Thanks Admin for sharing such a useful post, I hope it’s useful to many individuals for developing their skill to get good career.
devops online training

aws online training

data science with python online training

data science online training

rpa online training

83. Good post
Apponix Technologies
https://www.apponix.com/Python-Institute/Python-Training-in-Bangalore.html

84. Thanks For Sharing The Information The Information Shared Is Very Valuable Please Keep Updating Us Time Just Went On Reading The article Python Online Course Hadoop Online Course Aws Online Course Data Science Online Course