This is 3 problems in one video covering a few different topics: use of constants, getting input from a user, printing to the console, using random numbers as well as some other basic python features.
★ Timestamps ★
00:00 intro
00:56 subtract numbers from user input
06:04 random numbers
09:32 countdown to liftoff
Problem 1:
Write a program in the file subtract_numbers.py that reads two real numbers from
the user and prints the first number minus the second number. You can assume the
user will always enter valid real numbers as input (negative values are fine).
Problem 2:
Write a program in the file random_numbers.py that prints 10 random integers (each
random integer should have a value between 0 and 100, inclusive). Your program
should use a constant named NUM_RANDOM, which determines the number of random
numbers to print (with a value of 10). It should also use constants named MIN_RANDOM
and MAX_RANDOM to determine the minimal and maximal values of the random numbers
generated (with respective values 0 and 100). To generate random numbers, you should
use the function random.randint() from Python’s random library
Problem 3:
Write a program in the file liftoff.py that prints out the calls for a spaceship that is
about to launch. Countdown the numbers from 10 to 1 and then write “Liftoff!” Your
program should include a for loop using range.
If you enjoyed this video and want to see more videos on learning to code, please don’t forget to Like, Subscribe and Share ❤️
New videos every Sunday, Tuesday and Thursday. Don't miss the next one :)
Sunday - Educational
Tuesday - Youtube Related or Lifestyle
Thursday - Covers
Follow Me on Socials -
IG - / tiffanyarielle
twitter - / tiff_arielle
website - https://www.tiffanyarielle.com
tiktok - www.tiktok.com/@tiffany_arielle
If you are interested in any of the equipment I use, please support me by using the links below 💜
Equipment/Software:
iPhone12 pro
MacBook Pro
Final Cut Pro X
GarageBand
ring light: https://amzn.to/3klidpP
microphone: https://amzn.to/3m7oXrK
Contact Info:
[email protected]
PO Box 2091
Pflugerville, TX 78691
Background Music: https://www.bensound.com
Keywords:
#Python
#UserInput
#RandomNumbers
#LearnToCode