{ "cells": [ { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "# Statements Assessment Test\n", "Lets test your knowledge!" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "_____\n", "**Use for, split(), and if to create a Statement that will print out words that start with 's':**" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": true }, "outputs": [], "source": [ "st = 'Print only the words that start with s in this sentence'" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [], "source": [ "#Code here" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "______\n", "**Use range() to print all the even numbers from 0 to 10.**" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [], "source": [ "#Code Here" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "___\n", "**Use List comprehension to create a list of all numbers between 1 and 50 that are divisible by 3.**" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "[]" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#Code in this cell\n", "[]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "_____\n", "**Go through the string below and if the length of a word is even print \"even!\"**" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": true }, "outputs": [], "source": [ "st = 'Print every word in this sentence that has an even number of letters'" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": true }, "outputs": [], "source": [ "#Code in this cell" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "____\n", "**Write a program that prints the integers 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\".**" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "#Code in this cell" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "____\n", "**Use List Comprehension to create a list of the first letters of every word in the string below:**" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "collapsed": true }, "outputs": [], "source": [ "st = 'Create a list of the first letters of every word in this string'" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": true }, "outputs": [], "source": [ "#Code in this cell" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Great Job!" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.11" } }, "nbformat": 4, "nbformat_minor": 0 }