Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding Variables
#1
Hello! I am working on a program for guitar. This is a rather simple problem but I am new to coding and don't know why the heck this is not working. I tried two ways, as you can see below. Any help is appreciated. Thanks!
E_String = input('What are you fretting on the low E string? ')
A_String = input('What are you fretting on the A string? ')
D_String = input('What are you fretting on the D string? ')
G_String = input('What are you fretting on the G string? ')
B_String = input('What are you fretting on the B string? ')
e_String = input('What are you fretting on the high e string? ')
all_string_sum = (E_String + A_String + D_String + G_String + B_String + e_String)
if all_string_sum == '1':
    print ("E")
Method #2

if E_String + A_String + D_String + G_String + B_String + e_String == '1':
    print("D+")
Reply


Messages In This Thread
Adding Variables - by absolum - Jul-17-2019, 06:58 PM
RE: Adding Variables - by abi17124 - Jul-17-2019, 07:31 PM
RE: Adding Variables - by jefsummers - Jul-17-2019, 08:15 PM
RE: Adding Variables - by absolum - Jul-18-2019, 12:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  variables vcnt, ocnt, and mcnt adding previous values and not resetting to 0 archanut 2 653 Feb-12-2021, 06:56 PM
Last Post: deanhystad
  adding properties to variables rudihammad 0 793 May-06-2020, 05:09 AM
Last Post: rudihammad
  Adding markers to Folium map only adding last element. tantony 0 1,093 Oct-16-2019, 03:28 PM
Last Post: tantony

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020