Ask the user for a random number and assign the value to a variable named starting. Then using a for loop and write a program that asks the user for input of 5 numbers. Each of these numbers must be added to the initial value of the variable starting. The output must be the initial and final value of the variable starting. Please name the program and provide at least one code comment.
What is the datatype of the length, width, area and perimeter above?
Hint: Use Python's type(var_1) to find out.
Divide any of the variables above by any number (except 0 !), assign it to variable. What is the datatype of the resulting variable?
What did you find out?
The length of rectangle is given as 10, its width is given as 20. Calculate its area and perimeter.
Hint
So your output should look like this: "The rectangle whose length is 10 and width 20 has the area 200 and perimeter 60."
Print a sentence joining the fruit and ripeness variable. Print any sentence that uses this variables (fruit and ripeness)
For example: "That lemon is rotten" or The avocado is ready to eat
Implement this exercise using the .format() method
Print a sentence joining the fruit and ripeness variable. Print any sentence that uses this variables (fruit and ripeness)
For example: "That lemon is rotten" and I can not eat it
Implement this exercise using the Python's F-string literal
Set the variable called greeting to some greeting, e.g. "hello".
Set the variable called name to some name, e.g. "John".
Then set the variable called greet_name that that concatenates greeting , name , and a space " " between them.
Define a variable named is_having_fun and set it to a Boolean value
Define a variable named high_score and set it equal to any int
Define a variable named price and set it equal to any float
Define a variable named city and set it equal to any string