This repo contains the solutions for the exercises during the introduction to programming session with Python. To learn more about Python a good starting point would be Codecademy
Create well named variables for each of the following:
- First name
- Surname
- University attended
- Age
- Maximum heart rate (220-Age) Print each of the variables
Print each variable you created in its own sentence
Use user input to get values for each of your variables. Prompt the user to enter a value for each one. Continue to print each one in its own sentence
Continue to build upon what you have done. Prompt the user for y/n input whether they can drive or not
Print suitable messages for the following conditions:
- Can drive and are above legal age
- Can drive but are below the legal age
- Can’t drive and are below legal age
- Can’t drive but are above the legal age
Prompt the user for a sentence Use a loop to remove any letters that are vowels Print the new sentence
Create a functions to:
- Calculate max heart rate
- Remove vowels from a given string
Use each function multiple times and print result
Define a function called fizz_buzz that has one integer parameter. It should:
- Return Fizz when the integer is a multiple of 3
- Return Buzz when the integer is a multiple of 5
- Return FizzBuzz when integer is a multiple of both 3 and 5
- Return the integer without any modification in all other cases
Write a function called challenge that will call the fizz_buzz function for all integers from 1 to 100 and print the result of each time
- Write a program to play ’Rock, Paper, Scissors’ against the computer. It should
- Print a welcome message
- Make a random choice for the computer
- Ask the user for their choice, repeat until it’s a valid one
- Print the result (Win/Lose/Draw)
Ask the player if they want to play again. Print the score at the end of the game session (W/D/L record)
- Write a program that displays the vending machine to a user
- Prompt them for the co-ordinates of their selection
- Print the name of the item they pick
- Write a program where users can input the name of a movie
- Output the names of the main actors for that movie
- Handle scenario where movie is not known