My homework asks to create a variable that contains a string.
The string is to contain a few phrases, line breaks, and other variables that contain strings and an integer.
So far I am running into a few errors, namely the "unexpected character after line cont." and the one that says the string can't "process" (I forgot the exact wording) the integer...
Below is what I have so far.
The assignment asks for me to contain a string, that when printed, displays text formatted such as below;
First Name: XXXX
Last Name: XXXX
Student ID: XXXX
If you can provide any insight I would be so grateful!! Thank you
alright, first you have to define some variables like:
And then you have to print the formatted string, There few way can do it.
1. string concatenation
I am won’t recommend this way(string+string).
2. “.format()”
3. f-string
i will recommend this (f-string)
4. Modulo String