48.2k views
1 vote
Write a Python program that prints your name, CS classes taken (or other relevant experience), and the date on separate lines. Use one variable each for the month, day, and year (3 total). Make sure there are no spaces between the forward slash and numbers. Submit the .py file. Sample Run: My name is Steven Allbee I have taken CS 10 - Python Programming Today's date is 1/17/19

User Jaxian
by
5.2k points

1 Answer

1 vote

Answer:

The program in Python is as follows:

name = input("Name: ")

course = input("Course: ")

month = input("Month: ")

day = input("Day: ")

year = input("Year: ")

ddate = (month+"/"+day+"/"+year).replace(" ", "")

print("My name is ",name)

print("I have taken ",course)

print("Today's date is ",ddate)

Step-by-step explanation:

This line prompts user for name

name = input("Name: ")

This line prompts user for course classes taken

course = input("Course: ")

This line prompts user for month

month = input("Month: ")

This line prompts user for day

day = input("Day: ")

This line prompts user for year

year = input("Year: ")

This line calculates the date and remove all blank spaces

ddate = (month+"/"+day+"/"+year).replace(" ", "")

The next three lines print the user inputs

print("My name is ",name)

print("I have taken ",course)

print("Today's date is ",ddate)

User Dreamwalker
by
5.1k points