Giter VIP home page Giter VIP logo

aisaturdays_beginner2018's Introduction

AI-Saturdays Nairobi - Beginner

This exerise is designed to assess your programming capabilities. Submissions received before Thursday August 2nd 2018 will be considered for the AI-Saturdays 2018 Beginner Track.

Task 1

Everytime you run the snippet of code below, a new random list, ourList of 10 integers between 1 and 10 is generated. Extend the snippet to create a valriable belowFive with only the elemets of ourList that are below 5.

import random 

ourList = list()
count = 0 
while (count < 11):
    ourList.append(random.randint(1,10))
    count += 1
    
ourList

Task 2

Everytime you run the snippet of code below, a new random 4-word string, randomPhrase is generated.

import random

words = [word.rstrip('\n') for word in open('words.txt')]
randomPhrase = " ".join([words[random.randrange(0, len(words))] for i in range(4)])

randomPhrase

Extend the snippet to reverse both the order of the 4 words and the order of the letters in each word. Save this in a variable called reversePhrase. eg.

band prize boss complex

would become:

xelpmoc ssob ezirp dnab

Working on the Exercise

1.Fork the code challenge repository provided.

2.Make a topic branch. In your github form, keep the master branch clean. When you create a branch, it essentially will be a copy of the master.

Pull all changes, make sure your repository is up to date

$ cd aiSaturdays_Beginner2018
$ git pull origin master

Create a new branch as follows-> git checkout -b [your_email], e.g.

$ git checkout -b [email protected] master

See all branches created

$ git branch
* [email protected]
  master

Push the new branch to github

$ git push origin -u [email protected]

3.Remember to only make changes to the fork!

Edit the task1 and task2 .py files in the repository folder and solve the set out exercises. Each file should be concluded with a print() statement that prints out the desired result.

eg.

print(belowFive)
print(reversePhrase)

4.Commit the changes to your fork.

5.Make a pull request to the aiSaturdays_Beginner2018 Repo.

aisaturdays_beginner2018's People

Contributors

witty-kitty avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.