Hour of Python – Coding Challenge 7 | Number of Things

Python

Video is ready, Click Here to View ×


Enroll for exercises, tutorials, courses, and projects…
http://cleverprogrammer.to/enroll

Enroll in Learn Python™ course
http://cleverprogrammer.to/enroll

==================================================
Connect With Me!

Website ► http://cleverprogrammer.to/enroll
Facebook ► http://cleverprogrammer.to/facebook
Twitter ► http://cleverprogrammer.to/twitter
Instagram ► http://cleverprogrammer.to/instagram
Snapchat ► Rafeh1
iTunes Podcast ►…

27 thoughts on “Hour of Python – Coding Challenge 7 | Number of Things

  1. def formating(from_list):
    if from_list[0]== 1:
    return "There is " + str(from_list[0]) + ' ' +from_list[1]
    else:
    return "There are "+ str(from_list[0]) + ' '+ from_list[1] +'s.'

    print (formating([1, 'king']))
    print (formating([5, 'monkey']))

  2. here is my solution
    def how_many(the_list):

    if the_list[0]>1:
    return 'there are %s %ss.' %(the_list[0],the_list[1])
    else:
    return 'there is %s %s.' %(the_list[0],the_list[1])

    return the_list

    print(how_many([5,'trinket']))
    print(how_many([1,'king']))

  3. def number_of_things(list_):
    if list_[0] > 1:
    return "There are {} {}s.".format(list_[0], list_[1])
    else:
    return "There is {} {}.".format(list_[0], list_[1])

    print(number_of_things([1, 'banana']))
    print(number_of_things([7, 'banana']))

  4. Hello.

    So I installed Python 3 and could do simple stuff with it like printing or using the calculator. But I could not find the "scripts" folder nor can I find the Python36 folder in my C driver (Im using Windows). I installed Python 2 and everything went better. I was able to install stuff like Pip, create the path for python and so on.

    Why is that? Should I resort to Python 2 and leave 3?

    Thank you.

  5. hi , ill be going to college in few weeks pursuing geuss what , and my curriculum starts with c so i started with geuss what , im a hugeass beginner so i have this question ? i have an idea for this social networking site ( go ahead gudge me ) what languages do i need to learn to build a beautiful geuss what and also i want the app to be ultra smooth on even low end android devices ( ios one just needs to be smooth) …….. it would be really helpful if you responded …….
    also i know this is completely irrelevant ……… #askqazi

  6. def how_many(the_list):
    if the_list[0] == 1:
    return 'There is {} {}'.format(the_list[0],the_list[1])
    else:
    return 'There are {} {}s'.format(the_list[0] ,the_list[1])
    return the_list
    print(how_many([1, 'trinket']))
    print(how_many([5, 'King']))
    #This is a cleaner way than any other.

  7. def how_many(list):
    if list[0] == 1 :
    sentence = 'There %s %s %s.'%('is',list[0],list[1])
    print sentence
    elif list[0] >= 2:
    sentence = 'There %s %s %s.'%('are',list[0],list[1]+'s')
    print sentence

    print how_many([5,"Trinkets"])
    print how_many([1,"King"])

  8. def how_many(the_list):
    if the_list[0] > 1:
    print("There are %s %s"%(the_list [0],the_list [1]+"s")+".")
    else:
    print("There is %s %s"%(the_list [0],the_list [1]+"."))

    how_many ([1,"king"])
    how_many ([4,"apple"])

Leave a Reply

Your email address will not be published. Required fields are marked *