Home > Mobile >  How to print the updated output
How to print the updated output

Time:11-11

EMpty code please delete thread

CodePudding user response:

When you change one of the fields, you use a different variable than the one you use when printing out the info after changing other fields. E.g. you assign the new first name to cf_name, but the rest of the code expects it to be in name. You need to use the same variable consistently.

So change

    if option1 == '1':
        cf_name = str(input('Enter First name: '))
        F_name.clear()
        F_name.append(cf_name)
        print('****** This is your updated info *******')
        print(f'First name is: {cf_name}')
        print(f'Middle name is: {mid_name}')
        print(f'Last name is: {last_name}')
        print(f'Number of subjects: {n_sub}')
        print(f'Your Selected Subjects are: {o_sub}')

to

    if option1 == '1':
        name = str(input('Enter First name: '))
        F_name.clear()
        F_name.append(name)
        print('****** This is your updated info *******')
        print(f'First name is: {name}')
        print(f'Middle name is: {mid_name}')
        print(f'Last name is: {last_name}')
        print(f'Number of subjects: {n_sub}')
        print(f'Your Selected Subjects are: {o_sub}')

And change the other options similarly.

  • Related