0
Print list index without quotes and assign it to a veriable
I want to print a list content without quotes and assign it to a veriable so I can use it in if else statements later. Here is mylist: Mylist=['11', '22', '33', '44'] I know to to print the values without quotes using >>>Print(*mylist) 11223344 But how do I assign 11223344 to a veriable such as x?
3 Respostas
+ 4
print(*Mylist) will output
11 22 33 44
Not 11223344
So if you want that
Use join method
x = "".join(Mylist)
print(x)
>>>11223344
Hope It Helps You 😊
0
Thank you Hacker badshah. Yes your method works great
0
You can turn around with for loop and print argument.https://code.sololearn.com/c3JsXImVGT1P/?ref=app