Ask coding questions

← Back to all posts
create a string Q1 and slice Q1
h
SeanFoltz

how do i create a string called Q1 with characters Welcome to MU! then slice Q1 to obtain only MU! and assign it Q2

Voters
SeanFoltz
Comments
hotnewtop
SixBeeps

You're looking for what Python calls string slicing. Here's a quick guide to those.

In general, Q2 is called a substring.