Good evening,
I am very basic at programming in python and am seeking help in finishing my first program.
If possible help me with.
1.The welcome message. I want it to display as the image below
2. The end result so it is displayed continuously on one line like the image below.
Thank you.
****************************************
Things I've tried
implicit continuation
print(average_player) + (display_avg)
print ()
#Line 34
Explicit continuation
print(average_player) \
+ (display_avg)
#Line 34
print(average_player) + "'s average hit" + display_avg)
print ()
#I've changed the average_player variable to only display the name or display the name and the string "'s average hit"
**************************
<a href="https://ibb.co/cwA7Jb"><img src="https://thumb.ibb.co/cwA7Jb/Baseball_Team_management.jpg" alt="Baseball_Team_management" border="0"></a>
<img>
https://ibb.co/cwA7Jb
</img>
The program should display as above.
Below is my source code.
-------------------------------------------------------------------------------------
#!/usr/bin/env python3
import locale
#display a welcome message
print("===============================================================")
print ()
print(" Baseball Team Manager")
print ()
print("This program calculates the batting average for a player based")
print ()
print("on the player's official number of at bats and hits.")
print ()
print("================================================================")
print ()
choice = "y"
while choice.lower() == "y":
# get input from the user
player_names = str(input("Player's name:\t"))
official_at_bat = int(input("Official number at bat:\t"))
number_of_hits = int(input("Number of hits:\t"))
average_player = str(input(player_names)+ "'s batting average is")
# convert the players batting average
average_hit = float(
number_of_hits / official_at_bat)
#Average hits
display_avg = round(average_hit,3)
# display the batting avrage
print(average_player)
print(display_avg)
print ()
print ()
# see if the user wants to continue
print
choice = input("continue? ( y/n): ")
print ()
print("Bye!")
----------------------------------------------------------------------------------
I am very basic at programming in python and am seeking help in finishing my first program.
If possible help me with.
1.The welcome message. I want it to display as the image below
2. The end result so it is displayed continuously on one line like the image below.
Thank you.
****************************************
Things I've tried
implicit continuation
print(average_player) + (display_avg)
print ()
#Line 34
Explicit continuation
print(average_player) \
+ (display_avg)
#Line 34
print(average_player) + "'s average hit" + display_avg)
print ()
#I've changed the average_player variable to only display the name or display the name and the string "'s average hit"
**************************
<a href="https://ibb.co/cwA7Jb"><img src="https://thumb.ibb.co/cwA7Jb/Baseball_Team_management.jpg" alt="Baseball_Team_management" border="0"></a>
<img>
https://ibb.co/cwA7Jb
</img>
The program should display as above.
Below is my source code.
-------------------------------------------------------------------------------------
#!/usr/bin/env python3
import locale
#display a welcome message
print("===============================================================")
print ()
print(" Baseball Team Manager")
print ()
print("This program calculates the batting average for a player based")
print ()
print("on the player's official number of at bats and hits.")
print ()
print("================================================================")
print ()
choice = "y"
while choice.lower() == "y":
# get input from the user
player_names = str(input("Player's name:\t"))
official_at_bat = int(input("Official number at bat:\t"))
number_of_hits = int(input("Number of hits:\t"))
average_player = str(input(player_names)+ "'s batting average is")
# convert the players batting average
average_hit = float(
number_of_hits / official_at_bat)
#Average hits
display_avg = round(average_hit,3)
# display the batting avrage
print(average_player)
print(display_avg)
print ()
print ()
# see if the user wants to continue
choice = input("continue? ( y/n): ")
print ()
print("Bye!")
----------------------------------------------------------------------------------