jjdj5218
01.03.2021 •
Computers and Technology
Consider the following code segment. What are the values of count1 and count2 as a result of executing the code segment?
Solved
Show answers
More tips
- O Other What happens if you get scared half to death twice?...
- H Horoscopes, Magic, Divination Where Did Tarot Cards Come From?...
- S Style and Beauty How to Make Your Lips Fuller? Ideas and Tips for Beautiful Lips...
- S Style and Beauty How are artificial nails removed?...
- F Family and Home How to Sew Curtain Tapes: Best Tips from Professionals...
- H Horoscopes, Magic, Divination How to Cast a Love Spell on a Guy? Guide for Guys...
- F Family and Home How to Properly Use a Water Level?...
- L Legal consultation What Documents Are Required for a Russian Passport?...
- H Health and Medicine How to Treat Styes: Causes, Symptoms, and Home Remedies...
- F Family and Home Protect Your Home or Apartment from Pesky Ants...
Answers on questions: Computers and Technology
- C Computers and Technology Anyone else getting 502 bad gateway on here?...
- M Mathematics •What is the slope: •What is the y- intercept: •Now write an equation in slope intercept form with this information:...
- H History According to the quote below, the governor supports Manifest Destiny. A U.S. governor, speaking about the possible consequences of the Mexican War: Oh Mr. President,...
Ответ:
In python, date and time seem to be not its type of data, but the date and time named module can be imported for it to work with the time and date. So, the program and its description can be defined as follows:
Program Explanation:
Importing "datetime" package.Defining two-variable "name, age" in which we input value from user-end.Defining another variable "year" that holds current year value.In the next step, the print method has used that prints the user name with the born year.Program:
import datetime#import package datetime
name = input("What is your name? ")#defining a variable name that uses an inputs method to input string value
age = int(input("How old are you? "))#defining a variable age that uses an inputs method with the int to input value
year = datetime.datetime.now().year#defining a variable year that takes current value in it
print("Hello " + name + " you were born in " + str((year - age)))#defining a print method that print name value with born year
Output:
Please find the attached file.
Learn more:
link